diff --git a/applications/external/asteroids/app.c b/applications/external/asteroids/app.c index fa116a3cd..4f840b1b6 100644 --- a/applications/external/asteroids/app.c +++ b/applications/external/asteroids/app.c @@ -13,7 +13,8 @@ #include #include #include -#include +#include "asteroids_icons.h" +#include #define TAG "Asteroids" // Used for logging #define DEBUG_MSG 0 diff --git a/applications/external/bpmtapper/application.fam b/applications/external/bpmtapper/application.fam index 5e824813e..bf3f3c895 100644 --- a/applications/external/bpmtapper/application.fam +++ b/applications/external/bpmtapper/application.fam @@ -8,6 +8,7 @@ App( stack_size=2 * 1024, fap_icon="bpm_10px.png", fap_category="Media", + fap_icon_assets="icons", order=15, fap_author="@panki27", fap_weburl="https://github.com/panki27/bpm-tapper", diff --git a/applications/external/bpmtapper/bpm.c b/applications/external/bpmtapper/bpm.c index 8353019df..2fb5f8f3e 100644 --- a/applications/external/bpmtapper/bpm.c +++ b/applications/external/bpmtapper/bpm.c @@ -4,7 +4,8 @@ #include #include #include -#include "assets_icons.h" +#include "bpm_tapper_icons.h" +#include typedef enum { EventTypeTick, diff --git a/applications/external/brainfuck/brainfuck_i.h b/applications/external/brainfuck/brainfuck_i.h index 1258c5d3c..d4d7bb3ea 100644 --- a/applications/external/brainfuck/brainfuck_i.h +++ b/applications/external/brainfuck/brainfuck_i.h @@ -29,7 +29,7 @@ typedef unsigned char byte; #include #include -#include +#include "brainfuck_icons.h" #include #include diff --git a/applications/external/brainfuck/worker.c b/applications/external/brainfuck/worker.c index 8fed94b40..584bb9fb8 100644 --- a/applications/external/brainfuck/worker.c +++ b/applications/external/brainfuck/worker.c @@ -111,7 +111,7 @@ void rShift() { memset((tmp + stackSize) - BF_STACK_STEP_SIZE, 0x00, BF_STACK_STEP_SIZE); bfStack = (uint8_t*)tmp; - } + }; if(stackPtr > stackSizeReal) { stackSizeReal = stackPtr; } diff --git a/applications/external/counter/application.fam b/applications/external/counter/application.fam index 6f2703307..b3ce43ecb 100644 --- a/applications/external/counter/application.fam +++ b/applications/external/counter/application.fam @@ -7,7 +7,8 @@ App( "gui", ], fap_category="Tools", - fap_icon="counter_icon.png", + fap_icon="icons/counter_icon.png", + fap_icon_assets="icons", fap_author="@Krulknul", fap_weburl="https://github.com/Krulknul/dolphin-counter", fap_version="1.1", diff --git a/applications/external/counter/counter.c b/applications/external/counter/counter.c index 67b45170b..cbc0d9b80 100644 --- a/applications/external/counter/counter.c +++ b/applications/external/counter/counter.c @@ -2,6 +2,8 @@ #include #include #include +#include "counter_icons.h" +#include #define MAX_COUNT 99 #define BOXTIME 2 diff --git a/applications/external/counter/counter_icon.png b/applications/external/counter/counter_icon.png deleted file mode 100644 index 4b8358b42..000000000 Binary files a/applications/external/counter/counter_icon.png and /dev/null differ diff --git a/applications/external/counter/icons/counter_icon.png b/applications/external/counter/icons/counter_icon.png new file mode 100644 index 000000000..47efe68db Binary files /dev/null and b/applications/external/counter/icons/counter_icon.png differ diff --git a/applications/external/esp_flasher/LICENSE b/applications/external/esp_flasher/LICENSE new file mode 100644 index 000000000..f288702d2 --- /dev/null +++ b/applications/external/esp_flasher/LICENSE @@ -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/applications/external/esp_flasher/application.fam b/applications/external/esp_flasher/application.fam index ff5d0774b..8c56a34d6 100644 --- a/applications/external/esp_flasher/application.fam +++ b/applications/external/esp_flasher/application.fam @@ -1,6 +1,7 @@ App( appid="esp_flasher", - name="[GPIO] ESP Flasher", + name="[ESP] Flasher", + fap_version=(1, 1), apptype=FlipperAppType.EXTERNAL, entry_point="esp_flasher_app", requires=["gui"], diff --git a/applications/external/esp_flasher/assets/DolphinCommon_56x48.png b/applications/external/esp_flasher/assets/DolphinCommon_56x48.png deleted file mode 100644 index 089aaed83..000000000 Binary files a/applications/external/esp_flasher/assets/DolphinCommon_56x48.png and /dev/null differ diff --git a/applications/external/esp_flasher/assets/KeyKeyboardSelected_10x11.png b/applications/external/esp_flasher/assets/KeyKeyboardSelected_10x11.png deleted file mode 100644 index 231880386..000000000 Binary files a/applications/external/esp_flasher/assets/KeyKeyboardSelected_10x11.png and /dev/null differ diff --git a/applications/external/esp_flasher/assets/KeyKeyboard_10x11.png b/applications/external/esp_flasher/assets/KeyKeyboard_10x11.png deleted file mode 100644 index 1f4c03478..000000000 Binary files a/applications/external/esp_flasher/assets/KeyKeyboard_10x11.png and /dev/null differ diff --git a/applications/external/esp_flasher/assets/WarningDolphin_45x42.png b/applications/external/esp_flasher/assets/WarningDolphin_45x42.png deleted file mode 100644 index d766ffbb4..000000000 Binary files a/applications/external/esp_flasher/assets/WarningDolphin_45x42.png and /dev/null differ diff --git a/applications/external/esp_flasher/esp_flasher_app.c b/applications/external/esp_flasher/esp_flasher_app.c index e29bb148f..cf299c4c5 100644 --- a/applications/external/esp_flasher/esp_flasher_app.c +++ b/applications/external/esp_flasher/esp_flasher_app.c @@ -27,6 +27,7 @@ EspFlasherApp* esp_flasher_app_alloc() { app->gui = furi_record_open(RECORD_GUI); app->dialogs = furi_record_open(RECORD_DIALOGS); app->storage = furi_record_open(RECORD_STORAGE); + app->notification = furi_record_open(RECORD_NOTIFICATION); app->view_dispatcher = view_dispatcher_alloc(); app->scene_manager = scene_manager_alloc(&esp_flasher_scene_handlers, app); @@ -65,6 +66,9 @@ EspFlasherApp* esp_flasher_app_alloc() { app->flash_worker_busy = false; + app->reset = false; + app->boot = false; + scene_manager_next_scene(app->scene_manager, EspFlasherSceneStart); return app; @@ -103,6 +107,7 @@ void esp_flasher_app_free(EspFlasherApp* app) { furi_record_close(RECORD_GUI); furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_DIALOGS); + furi_record_close(RECORD_NOTIFICATION); free(app); } diff --git a/applications/external/esp_flasher/esp_flasher_app.h b/applications/external/esp_flasher/esp_flasher_app.h index 413dd58a3..809fcc6fc 100644 --- a/applications/external/esp_flasher/esp_flasher_app.h +++ b/applications/external/esp_flasher/esp_flasher_app.h @@ -4,7 +4,7 @@ extern "C" { #endif -#define ESP_FLASHER_APP_VERSION "v1.0" +#define ESP_FLASHER_APP_VERSION "v1.1" typedef struct EspFlasherApp EspFlasherApp; diff --git a/applications/external/esp_flasher/esp_flasher_app_i.h b/applications/external/esp_flasher/esp_flasher_app_i.h index 9b8b81a29..8f533453f 100644 --- a/applications/external/esp_flasher/esp_flasher_app_i.h +++ b/applications/external/esp_flasher/esp_flasher_app_i.h @@ -16,10 +16,12 @@ #include #include -#include +#include "esp_flasher_icons.h" +#include #include #include #include +#include #define ESP_FLASHER_TEXT_BOX_STORE_SIZE (4096) @@ -47,6 +49,7 @@ struct EspFlasherApp { TextBox* text_box; Storage* storage; DialogsApp* dialogs; + NotificationApp* notification; VariableItemList* var_item_list; Widget* widget; @@ -54,6 +57,9 @@ struct EspFlasherApp { EspFlasherUart* uart; + bool reset; + bool boot; + bool selected_flash_options[NUM_FLASH_OPTIONS]; int num_selected_flash_options; char bin_file_path_boot[100]; diff --git a/applications/external/esp_flasher/esp_flasher_worker.c b/applications/external/esp_flasher/esp_flasher_worker.c index b5a647d4b..ef7ed1806 100644 --- a/applications/external/esp_flasher/esp_flasher_worker.c +++ b/applications/external/esp_flasher/esp_flasher_worker.c @@ -131,6 +131,9 @@ static int32_t esp_flasher_flash_bin(void* context) { flash_rx_stream = furi_stream_buffer_alloc(RX_BUF_SIZE, 1); timer = furi_timer_alloc(_timer_callback, FuriTimerTypePeriodic, app); + // turn on flipper blue LED for duration of flash + notification_message(app->notification, &sequence_set_only_blue_255); + loader_port_debug_print("Connecting\n"); esp_loader_connect_args_t connect_config = ESP_LOADER_CONNECT_DEFAULT(); err = esp_loader_connect(&connect_config); @@ -169,9 +172,21 @@ static int32_t esp_flasher_flash_bin(void* context) { loader_port_debug_print("Restoring transmission rate\n"); furi_hal_uart_set_br(FuriHalUartIdUSART1, 115200); #endif - loader_port_debug_print("Done flashing. Please reset the board manually.\n"); + loader_port_debug_print( + "Done flashing. Please reset the board manually if it doesn't auto-reset.\n"); + + // auto-reset for supported boards + loader_port_reset_target(); + + // short buzz to alert user + notification_message(app->notification, &sequence_set_vibro_on); + loader_port_delay_ms(50); + notification_message(app->notification, &sequence_reset_vibro); } + // turn off flipper blue LED + notification_message(app->notification, &sequence_reset_blue); + // done app->flash_worker_busy = false; @@ -182,6 +197,48 @@ static int32_t esp_flasher_flash_bin(void* context) { return 0; } +static void _initDTR(void) { + furi_hal_gpio_init(&gpio_ext_pc3, GpioModeOutputPushPull, GpioPullDown, GpioSpeedVeryHigh); +} + +static void _initRTS(void) { + furi_hal_gpio_init(&gpio_ext_pb2, GpioModeOutputPushPull, GpioPullDown, GpioSpeedVeryHigh); +} + +static void _setDTR(bool state) { + furi_hal_gpio_write(&gpio_ext_pc3, state); +} + +static void _setRTS(bool state) { + furi_hal_gpio_write(&gpio_ext_pb2, state); +} + +static int32_t esp_flasher_reset(void* context) { + EspFlasherApp* app = (void*)context; + + app->flash_worker_busy = true; + + _setDTR(false); + _initDTR(); + _setRTS(false); + _initRTS(); + + if(app->reset) { + loader_port_debug_print("Resetting board\n"); + loader_port_reset_target(); + } else if(app->boot) { + loader_port_debug_print("Entering bootloader\n"); + loader_port_enter_bootloader(); + } + + // done + app->flash_worker_busy = false; + app->reset = false; + app->boot = false; + + return 0; +} + void esp_flasher_worker_start_thread(EspFlasherApp* app) { global_app = app; @@ -189,7 +246,11 @@ void esp_flasher_worker_start_thread(EspFlasherApp* app) { furi_thread_set_name(app->flash_worker, "EspFlasherFlashWorker"); furi_thread_set_stack_size(app->flash_worker, 2048); furi_thread_set_context(app->flash_worker, app); - furi_thread_set_callback(app->flash_worker, esp_flasher_flash_bin); + if(app->reset || app->boot) { + furi_thread_set_callback(app->flash_worker, esp_flasher_reset); + } else { + furi_thread_set_callback(app->flash_worker, esp_flasher_flash_bin); + } furi_thread_start(app->flash_worker); } @@ -213,8 +274,19 @@ esp_loader_error_t loader_port_write(const uint8_t* data, uint16_t size, uint32_ return ESP_LOADER_SUCCESS; } +void loader_port_reset_target(void) { + _setDTR(true); + loader_port_delay_ms(SERIAL_FLASHER_RESET_HOLD_TIME_MS); + _setDTR(false); +} + void loader_port_enter_bootloader(void) { - // unimplemented + _setDTR(true); + loader_port_delay_ms(SERIAL_FLASHER_RESET_HOLD_TIME_MS); + _setRTS(true); + _setDTR(false); + loader_port_delay_ms(SERIAL_FLASHER_BOOT_HOLD_TIME_MS); + _setRTS(false); } void loader_port_delay_ms(uint32_t ms) { diff --git a/applications/external/esp_flasher/esp_flasher_worker.h b/applications/external/esp_flasher/esp_flasher_worker.h index 00c43a301..44461e7d4 100644 --- a/applications/external/esp_flasher/esp_flasher_worker.h +++ b/applications/external/esp_flasher/esp_flasher_worker.h @@ -2,7 +2,11 @@ #include "esp_flasher_app_i.h" #include "esp_flasher_uart.h" +#ifndef SERIAL_FLASHER_INTERFACE_UART #define SERIAL_FLASHER_INTERFACE_UART /* TODO why is application.fam not passing this via cdefines */ +#endif +#define SERIAL_FLASHER_RESET_HOLD_TIME_MS 100 +#define SERIAL_FLASHER_BOOT_HOLD_TIME_MS 50 #include "esp_loader_io.h" #define ESP_ADDR_BOOT_S3 0x0 diff --git a/applications/external/esp_flasher/lib/esp-serial-flasher/CMakeCache.txt b/applications/external/esp_flasher/lib/esp-serial-flasher/CMakeCache.txt deleted file mode 100644 index 9d4eeffb3..000000000 --- a/applications/external/esp_flasher/lib/esp-serial-flasher/CMakeCache.txt +++ /dev/null @@ -1,366 +0,0 @@ -# This is the CMakeCache file. -# For build in directory: /home/cococode/flipperzero-firmware/lib/esp-serial-flasher -# It was generated by CMake: /usr/bin/cmake -# You can edit this file to change values found and used by cmake. -# If you do not want to change any of the values, simply exit the editor. -# If you do want to change a value, simply edit, save, and exit the editor. -# The syntax for the file is as follows: -# KEY:TYPE=VALUE -# KEY is the name of a variable in the cache. -# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. -# VALUE is the current value for the KEY. - -######################## -# EXTERNAL cache entries -######################## - -//Path to a program. -CMAKE_ADDR2LINE:FILEPATH=/usr/bin/addr2line - -//Path to a program. -CMAKE_AR:FILEPATH=/usr/bin/ar - -//Choose the type of build, options are: None Debug Release RelWithDebInfo -// MinSizeRel ... -CMAKE_BUILD_TYPE:STRING= - -//Enable/Disable color output during build. -CMAKE_COLOR_MAKEFILE:BOOL=ON - -//CXX compiler -CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++ - -//A wrapper around 'ar' adding the appropriate '--plugin' option -// for the GCC compiler -CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-9 - -//A wrapper around 'ranlib' adding the appropriate '--plugin' option -// for the GCC compiler -CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-9 - -//Flags used by the CXX compiler during all build types. -CMAKE_CXX_FLAGS:STRING= - -//Flags used by the CXX compiler during DEBUG builds. -CMAKE_CXX_FLAGS_DEBUG:STRING=-g - -//Flags used by the CXX compiler during MINSIZEREL builds. -CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the CXX compiler during RELEASE builds. -CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the CXX compiler during RELWITHDEBINFO builds. -CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//C compiler -CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc - -//A wrapper around 'ar' adding the appropriate '--plugin' option -// for the GCC compiler -CMAKE_C_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-9 - -//A wrapper around 'ranlib' adding the appropriate '--plugin' option -// for the GCC compiler -CMAKE_C_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-9 - -//Flags used by the C compiler during all build types. -CMAKE_C_FLAGS:STRING= - -//Flags used by the C compiler during DEBUG builds. -CMAKE_C_FLAGS_DEBUG:STRING=-g - -//Flags used by the C compiler during MINSIZEREL builds. -CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the C compiler during RELEASE builds. -CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the C compiler during RELWITHDEBINFO builds. -CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//Path to a program. -CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND - -//Flags used by the linker during all build types. -CMAKE_EXE_LINKER_FLAGS:STRING= - -//Flags used by the linker during DEBUG builds. -CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during MINSIZEREL builds. -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during RELEASE builds. -CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during RELWITHDEBINFO builds. -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Enable/Disable output of compile commands during generation. -CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF - -//Install path prefix, prepended onto install directories. -CMAKE_INSTALL_PREFIX:PATH=/usr/local - -//Path to a program. -CMAKE_LINKER:FILEPATH=/usr/bin/ld - -//Path to a program. -CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make - -//Flags used by the linker during the creation of modules during -// all build types. -CMAKE_MODULE_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of modules during -// DEBUG builds. -CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of modules during -// MINSIZEREL builds. -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of modules during -// RELEASE builds. -CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of modules during -// RELWITHDEBINFO builds. -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_NM:FILEPATH=/usr/bin/nm - -//Path to a program. -CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy - -//Path to a program. -CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump - -//Value Computed by CMake -CMAKE_PROJECT_DESCRIPTION:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_HOMEPAGE_URL:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_NAME:STATIC=Project - -//Path to a program. -CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib - -//Path to a program. -CMAKE_READELF:FILEPATH=/usr/bin/readelf - -//Flags used by the linker during the creation of shared libraries -// during all build types. -CMAKE_SHARED_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of shared libraries -// during DEBUG builds. -CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of shared libraries -// during MINSIZEREL builds. -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of shared libraries -// during RELEASE builds. -CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of shared libraries -// during RELWITHDEBINFO builds. -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//If set, runtime paths are not added when installing shared libraries, -// but are added when building. -CMAKE_SKIP_INSTALL_RPATH:BOOL=NO - -//If set, runtime paths are not added when using shared libraries. -CMAKE_SKIP_RPATH:BOOL=NO - -//Flags used by the linker during the creation of static libraries -// during all build types. -CMAKE_STATIC_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of static libraries -// during DEBUG builds. -CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of static libraries -// during MINSIZEREL builds. -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of static libraries -// during RELEASE builds. -CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of static libraries -// during RELWITHDEBINFO builds. -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_STRIP:FILEPATH=/usr/bin/strip - -//If this value is on, makefiles will be generated without the -// .SILENT directive, and all commands will be echoed to the console -// during the make. This is useful for debugging only. With Visual -// Studio IDE projects all commands are done without /nologo. -CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE - -//Value Computed by CMake -Project_BINARY_DIR:STATIC=/home/cococode/flipperzero-firmware/lib/esp-serial-flasher - -//Value Computed by CMake -Project_SOURCE_DIR:STATIC=/home/cococode/flipperzero-firmware/lib/esp-serial-flasher - - -######################## -# INTERNAL cache entries -######################## - -//ADVANCED property for variable: CMAKE_ADDR2LINE -CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_AR -CMAKE_AR-ADVANCED:INTERNAL=1 -//This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/home/cococode/flipperzero-firmware/lib/esp-serial-flasher -//Major version of cmake used to create the current loaded cache -CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 -//Minor version of cmake used to create the current loaded cache -CMAKE_CACHE_MINOR_VERSION:INTERNAL=16 -//Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=3 -//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE -CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 -//Path to CMake executable. -CMAKE_COMMAND:INTERNAL=/usr/bin/cmake -//Path to cpack program executable. -CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack -//Path to ctest program executable. -CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest -//ADVANCED property for variable: CMAKE_CXX_COMPILER -CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_COMPILER_AR -CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB -CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS -CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG -CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL -CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE -CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO -CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER -CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER_AR -CMAKE_C_COMPILER_AR-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER_RANLIB -CMAKE_C_COMPILER_RANLIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS -CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG -CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL -CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE -CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO -CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_DLLTOOL -CMAKE_DLLTOOL-ADVANCED:INTERNAL=1 -//Executable file format -CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS -CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG -CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE -CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS -CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 -//Name of external makefile project generator. -CMAKE_EXTRA_GENERATOR:INTERNAL= -//Name of generator. -CMAKE_GENERATOR:INTERNAL=Unix Makefiles -//Generator instance identifier. -CMAKE_GENERATOR_INSTANCE:INTERNAL= -//Name of generator platform. -CMAKE_GENERATOR_PLATFORM:INTERNAL= -//Name of generator toolset. -CMAKE_GENERATOR_TOOLSET:INTERNAL= -//Source directory with the top level CMakeLists.txt file for this -// project -CMAKE_HOME_DIRECTORY:INTERNAL=/home/cococode/flipperzero-firmware/lib/esp-serial-flasher -//Install .so files without execute permission. -CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 -//ADVANCED property for variable: CMAKE_LINKER -CMAKE_LINKER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MAKE_PROGRAM -CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS -CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG -CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE -CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_NM -CMAKE_NM-ADVANCED:INTERNAL=1 -//number of local generators -CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJCOPY -CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJDUMP -CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 -//Platform information initialized -CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_RANLIB -CMAKE_RANLIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_READELF -CMAKE_READELF-ADVANCED:INTERNAL=1 -//Path to CMake installation. -CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.16 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS -CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG -CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE -CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH -CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_RPATH -CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS -CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG -CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE -CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STRIP -CMAKE_STRIP-ADVANCED:INTERNAL=1 -//uname command -CMAKE_UNAME:INTERNAL=/usr/bin/uname -//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE -CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 - diff --git a/applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_C.bin b/applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_C.bin old mode 100755 new mode 100644 diff --git a/applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin b/applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin old mode 100755 new mode 100644 diff --git a/applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/3.16.3/CompilerIdC/a.out b/applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/3.16.3/CompilerIdC/a.out old mode 100755 new mode 100644 diff --git a/applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/3.16.3/CompilerIdCXX/a.out b/applications/external/esp_flasher/lib/esp-serial-flasher/CMakeFiles/3.16.3/CompilerIdCXX/a.out old mode 100755 new mode 100644 diff --git a/applications/external/esp_flasher/lib/esp-serial-flasher/CMakeLists.txt b/applications/external/esp_flasher/lib/esp-serial-flasher/CMakeLists.txt deleted file mode 100644 index 7c83d2542..000000000 --- a/applications/external/esp_flasher/lib/esp-serial-flasher/CMakeLists.txt +++ /dev/null @@ -1,119 +0,0 @@ -cmake_minimum_required(VERSION 3.5) - -set(srcs - src/esp_targets.c - src/md5_hash.c - src/esp_loader.c - src/protocol_common.c -) - -if (DEFINED ESP_PLATFORM) - if (${CONFIG_SERIAL_FLASHER_INTERFACE_UART}) - list(APPEND srcs - src/protocol_uart.c - src/slip.c - port/esp32_port.c - ) - elseif (${CONFIG_SERIAL_FLASHER_INTERFACE_SPI}) - list(APPEND srcs - src/protocol_spi.c - port/esp32_spi_port.c - ) - endif() - # Register component to esp-idf build system - if ("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER "4.0") - # esp_timer component was introduced in v4.2 - set(priv_requires driver) - if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER "4.1") - list(APPEND priv_requires esp_timer) - endif() - - idf_component_register(SRCS ${srcs} - INCLUDE_DIRS include port - PRIV_INCLUDE_DIRS private_include - PRIV_REQUIRES ${priv_requires}) - - set(target ${COMPONENT_LIB}) - component_compile_options(-Wstrict-prototypes) - else() - # Remove when dropping support for IDF 3.3 - set(COMPONENT_SRCS ${srcs}) - set(COMPONENT_ADD_INCLUDEDIRS include port) - set(COMPONENT_PRIV_INCLUDEDIRS private_include) - register_component() - set(target ${COMPONENT_TARGET}) - endif() - -else() - if (NOT DEFINED SERIAL_FLASHER_INTERFACE_UART AND NOT DEFINED SERIAL_FLASHER_INTERFACE_SPI) - set(SERIAL_FLASHER_INTERFACE_UART true) - endif() - - if (DEFINED SERIAL_FLASHER_INTERFACE_UART) - list(APPEND srcs - src/protocol_uart.c - src/slip.c - ) - elseif (DEFINED SERIAL_FLASHER_INTERFACE_SPI) - list(APPEND srcs src/protocol_spi.c) - endif() - - # Create traditional CMake target - add_library(flasher ${srcs}) - - target_include_directories(flasher PUBLIC include port PRIVATE private_include) - - if(PORT STREQUAL "STM32") - target_link_libraries(flasher PUBLIC stm_cube) - target_sources(flasher PRIVATE port/stm32_port.c) - elseif(PORT STREQUAL "RASPBERRY_PI") - find_library(pigpio_LIB pigpio) - target_link_libraries(flasher PUBLIC ${pigpio_LIB}) - target_sources(flasher PRIVATE port/raspberry_port.c) - else() - message(FATAL_ERROR "Selected port is not supported") - endif() - - set(target flasher) - -endif() - -if (DEFINED SERIAL_FLASHER_INTERFACE_UART OR CONFIG_SERIAL_FLASHER_INTERFACE_UART STREQUAL "y") - target_compile_definitions(${target} - PUBLIC - SERIAL_FLASHER_INTERFACE_UART - ) - if (DEFINED MD5_ENABLED OR CONFIG_SERIAL_FLASHER_MD5_ENABLED) - target_compile_definitions(${target} PUBLIC MD5_ENABLED=1) - endif() -elseif (DEFINED SERIAL_FLASHER_INTERFACE_SPI OR CONFIG_SERIAL_FLASHER_INTERFACE_SPI STREQUAL "y") - target_compile_definitions(${target} - PUBLIC - SERIAL_FLASHER_INTERFACE_SPI - ) -endif() - -if(DEFINED SERIAL_FLASHER_DEBUG_TRACE OR CONFIG_SERIAL_FLASHER_DEBUG_TRACE) - target_compile_definitions(${target} PUBLIC SERIAL_FLASHER_DEBUG_TRACE) -endif() - -if(DEFINED CONFIG_SERIAL_FLASHER_RESET_HOLD_TIME_MS AND DEFINED CONFIG_SERIAL_FLASHER_BOOT_HOLD_TIME_MS) - target_compile_definitions(${target} - PUBLIC - SERIAL_FLASHER_RESET_HOLD_TIME_MS=${CONFIG_SERIAL_FLASHER_RESET_HOLD_TIME_MS} - SERIAL_FLASHER_BOOT_HOLD_TIME_MS=${CONFIG_SERIAL_FLASHER_BOOT_HOLD_TIME_MS} - ) -else() - if(NOT DEFINED SERIAL_FLASHER_RESET_HOLD_TIME_MS) - target_compile_definitions(${target} - PUBLIC - SERIAL_FLASHER_RESET_HOLD_TIME_MS=100 - ) - endif() - if(NOT DEFINED SERIAL_FLASHER_BOOT_HOLD_TIME_MS) - target_compile_definitions(${target} - PUBLIC - SERIAL_FLASHER_BOOT_HOLD_TIME_MS=50 - ) - endif() -endif() \ No newline at end of file diff --git a/applications/external/esp_flasher/lib/esp-serial-flasher/LICENSE b/applications/external/esp_flasher/lib/esp-serial-flasher/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/applications/external/esp_flasher/lib/esp-serial-flasher/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/applications/external/esp_flasher/lib/esp-serial-flasher/submodules/CMakeLists.txt b/applications/external/esp_flasher/lib/esp-serial-flasher/submodules/CMakeLists.txt deleted file mode 100644 index 59e665ac2..000000000 --- a/applications/external/esp_flasher/lib/esp-serial-flasher/submodules/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ - -cmake_minimum_required(VERSION 3.13) - -set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/stm32-cmake/cmake/gcc_stm32.cmake) -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/stm32-cmake/cmake) - -find_package(CMSIS REQUIRED) -find_package(STM32HAL COMPONENTS gpio tim uart REQUIRED) - -add_library(stm_cube_impl ${CMSIS_SOURCES} ${STM32HAL_SOURCES}) -target_include_directories(stm_cube_impl PUBLIC ${CMSIS_INCLUDE_DIRS} ${STM32HAL_INCLUDE_DIR}) -stm32_set_target_properties(stm_cube_impl) - -# stm_cube target is made to propagate properties of stm_cube_impl, as stm32_set_target_properties -# sets properties privately for given target. This eliminates need to call stm32_set_target_properties -# on every target that links against STM32HAL. -add_library(stm_cube INTERFACE) -target_link_libraries(stm_cube INTERFACE stm_cube_impl) -target_compile_definitions(stm_cube INTERFACE $) -target_link_options(stm_cube INTERFACE -T${CMAKE_CURRENT_BINARY_DIR}/stm_cube_impl_flash.ld) \ No newline at end of file diff --git a/applications/external/esp_flasher/lib/esp-serial-flasher/zephyr/CMakeLists.txt b/applications/external/esp_flasher/lib/esp-serial-flasher/zephyr/CMakeLists.txt deleted file mode 100644 index 97da4eaae..000000000 --- a/applications/external/esp_flasher/lib/esp-serial-flasher/zephyr/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -cmake_minimum_required(VERSION 3.5) - -if (CONFIG_ESP_SERIAL_FLASHER) - zephyr_include_directories( - "${ZEPHYR_CURRENT_MODULE_DIR}/include" - "${ZEPHYR_CURRENT_MODULE_DIR}/port" - "${ZEPHYR_CURRENT_MODULE_DIR}/private_include" - ) - - zephyr_interface_library_named(esp_flasher) - - zephyr_library() - - zephyr_library_sources(${ZEPHYR_CURRENT_MODULE_DIR}/src/esp_loader.c - ${ZEPHYR_CURRENT_MODULE_DIR}/src/esp_targets.c - ${ZEPHYR_CURRENT_MODULE_DIR}/src/protocol_common.c - ${ZEPHYR_CURRENT_MODULE_DIR}/src/protocol_uart.c - ${ZEPHYR_CURRENT_MODULE_DIR}/src/slip.c - ${ZEPHYR_CURRENT_MODULE_DIR}/src/md5_hash.c - ${ZEPHYR_CURRENT_MODULE_DIR}/port/zephyr_port.c - ) - - target_compile_definitions(esp_flasher INTERFACE SERIAL_FLASHER_INTERFACE_UART) - - zephyr_library_link_libraries(esp_flasher) - - if(DEFINED MD5_ENABLED OR CONFIG_SERIAL_FLASHER_MD5_ENABLED) - target_compile_definitions(esp_flasher INTERFACE -DMD5_ENABLED=1) - endif() -endif() diff --git a/applications/external/esp_flasher/scenes/esp_flasher_scene_start.c b/applications/external/esp_flasher/scenes/esp_flasher_scene_start.c index 0ae9eca30..d531b884a 100644 --- a/applications/external/esp_flasher/scenes/esp_flasher_scene_start.c +++ b/applications/external/esp_flasher/scenes/esp_flasher_scene_start.c @@ -4,6 +4,8 @@ enum SubmenuIndex { SubmenuIndexEspFlasherDevboardFlash, SubmenuIndexEspFlasherFlash, SubmenuIndexEspFlasherAbout, + SubmenuIndexEspFlasherReset, + SubmenuIndexEspFlasherBootloader, }; void esp_flasher_scene_start_submenu_callback(void* context, uint32_t index) { @@ -30,6 +32,18 @@ void esp_flasher_scene_start_on_enter(void* context) { SubmenuIndexEspFlasherFlash, esp_flasher_scene_start_submenu_callback, app); + submenu_add_item( + submenu, + "Reset Board", + SubmenuIndexEspFlasherReset, + esp_flasher_scene_start_submenu_callback, + app); + submenu_add_item( + submenu, + "Enter Bootloader", + SubmenuIndexEspFlasherBootloader, + esp_flasher_scene_start_submenu_callback, + app); submenu_add_item( submenu, "About", @@ -55,6 +69,14 @@ bool esp_flasher_scene_start_on_event(void* context, SceneManagerEvent event) { } else if(event.event == SubmenuIndexEspFlasherFlash) { scene_manager_next_scene(app->scene_manager, EspFlasherSceneBrowse); consumed = true; + } else if(event.event == SubmenuIndexEspFlasherReset) { + app->reset = true; + scene_manager_next_scene(app->scene_manager, EspFlasherSceneConsoleOutput); + consumed = true; + } else if(event.event == SubmenuIndexEspFlasherBootloader) { + app->boot = true; + scene_manager_next_scene(app->scene_manager, EspFlasherSceneConsoleOutput); + consumed = true; } else if(event.event == SubmenuIndexEspFlasherAbout) { scene_manager_next_scene(app->scene_manager, EspFlasherSceneAbout); consumed = true; @@ -70,4 +92,4 @@ void esp_flasher_scene_start_on_exit(void* context) { EspFlasherApp* app = context; submenu_reset(app->submenu); -} \ No newline at end of file +} diff --git a/applications/external/etch_a_sketch/application.fam b/applications/external/etch_a_sketch/application.fam index 22144a685..db1add1ab 100644 --- a/applications/external/etch_a_sketch/application.fam +++ b/applications/external/etch_a_sketch/application.fam @@ -9,6 +9,7 @@ App( order=175, fap_icon="etch-a-sketch-icon.png", fap_category="Media", + fap_icon_assets="assets", fap_author="@SimplyMinimal", fap_weburl="https://github.com/SimplyMinimal/FlipperZero-Etch-A-Sketch", fap_version="1.0", diff --git a/applications/external/etch_a_sketch/etch_a_sketch.c b/applications/external/etch_a_sketch/etch_a_sketch.c index 6fd6d3596..bc15d7e0c 100644 --- a/applications/external/etch_a_sketch/etch_a_sketch.c +++ b/applications/external/etch_a_sketch/etch_a_sketch.c @@ -1,4 +1,3 @@ -#include #include #include #include @@ -10,6 +9,8 @@ #include // Header-file for boolean data-type. #include #include +#include "etch_icons.h" +#include #define WIDTH 64 #define HEIGHT 32 diff --git a/applications/external/gpioreader_b/application.fam b/applications/external/gpioreader_b/application.fam index 06d9551a9..29fe701b6 100644 --- a/applications/external/gpioreader_b/application.fam +++ b/applications/external/gpioreader_b/application.fam @@ -8,4 +8,5 @@ App( order=50, fap_category="GPIO", fap_icon="icon.png", + fap_icon_assets="icons", ) diff --git a/applications/external/gpioreader_b/gpio_app_i.h b/applications/external/gpioreader_b/gpio_app_i.h index 52f76949d..00f269e9a 100644 --- a/applications/external/gpioreader_b/gpio_app_i.h +++ b/applications/external/gpioreader_b/gpio_app_i.h @@ -16,6 +16,7 @@ #include "views/gpio_test.h" #include "views/gpio_reader.h" #include "views/gpio_usb_uart.h" +#include "gpioreader2_icons.h" #include struct GpioApp { diff --git a/applications/external/hex_editor/application.fam b/applications/external/hex_editor/application.fam index 4b187e469..fa7c3f13e 100644 --- a/applications/external/hex_editor/application.fam +++ b/applications/external/hex_editor/application.fam @@ -15,6 +15,6 @@ App( fap_icon_assets="icons", fap_author="@dunaevai135", fap_weburl="https://github.com/dunaevai135/flipper-zero-hex_editor", - fap_version="1.0", - fap_description="Read any file line by line, and use Ok to edit char. Useful for NFC file - Edit Dump feature without PC/Phone.", + fap_version="1.1", + fap_description="Read text files line by line and edit them without a computer or smartphone.", ) diff --git a/applications/external/hex_editor/hex_editor.c b/applications/external/hex_editor/hex_editor.c index fe8eb8b83..15b22cf03 100644 --- a/applications/external/hex_editor/hex_editor.c +++ b/applications/external/hex_editor/hex_editor.c @@ -11,7 +11,7 @@ #include #include -#include +#include "hex_editor_icons.h" #include #define TAG "HexEditor" diff --git a/applications/external/ifttt/views/send_view.c b/applications/external/ifttt/views/send_view.c index 7debf650b..6046c39e3 100644 --- a/applications/external/ifttt/views/send_view.c +++ b/applications/external/ifttt/views/send_view.c @@ -38,7 +38,7 @@ void send_serial_command_send(ESerialCommand command) { break; default: return; - } + }; furi_hal_uart_tx(FuriHalUartIdUSART1, data, 1); } @@ -134,4 +134,4 @@ void send_view_set_data(SendView* send_view, bool connected) { furi_assert(send_view); with_view_model( send_view->view, SendViewModel * model, { model->connected = connected; }, true); -} +} \ No newline at end of file diff --git a/applications/external/ir_remote/application.fam b/applications/external/ir_remote/application.fam index d1ec0da80..c6c3de570 100644 --- a/applications/external/ir_remote/application.fam +++ b/applications/external/ir_remote/application.fam @@ -10,6 +10,7 @@ App( ], fap_category="Infrared", fap_icon="ir_10px.png", + fap_icon_assets="images", fap_author="@Hong5489 & @friebel & @d4ve10", fap_weburl="https://github.com/Hong5489/ir_remote", fap_version="1.0", diff --git a/applications/external/ir_remote/infrared_remote_app.c b/applications/external/ir_remote/infrared_remote_app.c index 5ced9e71f..c303ab2d3 100644 --- a/applications/external/ir_remote/infrared_remote_app.c +++ b/applications/external/ir_remote/infrared_remote_app.c @@ -6,6 +6,7 @@ #include #include #include +#include "ir_remote_icons.h" #include #include @@ -538,6 +539,7 @@ int32_t infrared_remote_app(char* p) { is_transmitting = true; } } + view_port_update(app->view_port); } } diff --git a/applications/external/lightmeter/application.fam b/applications/external/lightmeter/application.fam index 7ce8dcad2..a1ad9fd0e 100644 --- a/applications/external/lightmeter/application.fam +++ b/applications/external/lightmeter/application.fam @@ -6,7 +6,7 @@ App( requires=[ "gui", ], - stack_size= 4 * 1024, + stack_size=4 * 1024, order=90, fap_version=(1, 2), fap_icon="lightmeter.png", diff --git a/applications/external/mifare_fuzzer/application.fam b/applications/external/mifare_fuzzer/application.fam index 8674505f7..c90212286 100644 --- a/applications/external/mifare_fuzzer/application.fam +++ b/applications/external/mifare_fuzzer/application.fam @@ -9,8 +9,9 @@ App( ], stack_size=4 * 1024, order=30, - fap_icon="mifare_fuzzer_10px.png", + fap_icon="images/mifare_fuzzer_10px.png", fap_category="NFC", + fap_icon_assets="images", fap_author="@spheeere98", fap_weburl="https://github.com/spheeere98/mifare_fuzzer", fap_version="1.0", diff --git a/applications/external/mifare_fuzzer/mifare_fuzzer_10px.png b/applications/external/mifare_fuzzer/images/mifare_fuzzer_10px.png similarity index 100% rename from applications/external/mifare_fuzzer/mifare_fuzzer_10px.png rename to applications/external/mifare_fuzzer/images/mifare_fuzzer_10px.png diff --git a/applications/external/music_beeper/application.fam b/applications/external/music_beeper/application.fam index 404988ca6..a15af7e32 100644 --- a/applications/external/music_beeper/application.fam +++ b/applications/external/music_beeper/application.fam @@ -12,5 +12,6 @@ App( stack_size=2 * 1024, order=45, fap_icon="music_10px.png", + fap_icon_assets="icons", fap_category="Media", ) diff --git a/applications/external/music_beeper/music_beeper.c b/applications/external/music_beeper/music_beeper.c index 15eba821b..e3ddbe68f 100644 --- a/applications/external/music_beeper/music_beeper.c +++ b/applications/external/music_beeper/music_beeper.c @@ -3,6 +3,7 @@ #include #include +#include "music_beeper_icons.h" #include #include #include diff --git a/applications/external/music_beeper/music_beeper_worker.c b/applications/external/music_beeper/music_beeper_worker.c index c95fe8d3a..e06e77447 100644 --- a/applications/external/music_beeper/music_beeper_worker.c +++ b/applications/external/music_beeper/music_beeper_worker.c @@ -399,7 +399,7 @@ bool music_beeper_worker_load_rtttl_from_file(MusicBeeperWorker* instance, const if(!storage_file_open(file, file_path, FSAM_READ, FSOM_OPEN_EXISTING)) { FURI_LOG_E(TAG, "Unable to open file"); break; - } + }; uint16_t ret = 0; do { diff --git a/applications/external/music_tracker/application.fam b/applications/external/music_tracker/application.fam index 23bcee079..6c78a9bf6 100644 --- a/applications/external/music_tracker/application.fam +++ b/applications/external/music_tracker/application.fam @@ -12,6 +12,6 @@ App( fap_category="Media", fap_author="@DrZlo13", fap_weburl="https://github.com/DrZlo13/flipper-zero-music-tracker", - fap_version="1.0", + fap_version="1.1", fap_description="App plays hardcoded tracker song", ) diff --git a/applications/external/ocarina/application.fam b/applications/external/ocarina/application.fam index 686634023..552adfdeb 100644 --- a/applications/external/ocarina/application.fam +++ b/applications/external/ocarina/application.fam @@ -9,6 +9,7 @@ App( order=30, fap_icon="music_10px.png", fap_category="Media", + fap_icon_assets="icons", fap_author="@invalidna-me", fap_weburl="https://github.com/invalidna-me/flipperzero-ocarina", fap_version="1.0", diff --git a/applications/external/passgen/application.fam b/applications/external/passgen/application.fam index 6a9652dc1..afdc73329 100644 --- a/applications/external/passgen/application.fam +++ b/applications/external/passgen/application.fam @@ -9,4 +9,7 @@ App( fap_category="Tools", fap_icon="icons/passgen_icon.png", fap_icon_assets="icons", + fap_author="@anakod & @henrygab", + fap_version="1.1", + fap_description="Simple password generator", ) diff --git a/applications/external/passgen/passgen.c b/applications/external/passgen/passgen.c index 07a97a3c0..a09abead0 100644 --- a/applications/external/passgen/passgen.c +++ b/applications/external/passgen/passgen.c @@ -1,19 +1,20 @@ #include +#include #include #include #include #include #include -#include +#include "passgen_icons.h" #include -#include #define PASSGEN_MAX_LENGTH 16 +#define PASSGEN_CHARACTERS_LENGTH (26 * 4) #define PASSGEN_DIGITS "0123456789" #define PASSGEN_LETTERS_LOW "abcdefghijklmnopqrstuvwxyz" #define PASSGEN_LETTERS_UP "ABCDEFGHIJKLMNOPQRSTUVWXYZ" -#define PASSGEN_SPECIAL "!#$%%^&*.-_" +#define PASSGEN_SPECIAL "!#$%^&*.-_" typedef enum PassGen_Alphabet { Digits = 1, @@ -27,6 +28,25 @@ typedef enum PassGen_Alphabet { Mixed = DigitsAllLetters | Special } PassGen_Alphabet; +const char* const PassGen_AlphabetChars[16] = { + "0", // invalid value + /* PASSGEN_SPECIAL PASSGEN_LETTERS_UP PASSGEN_LETTERS_LOW */ PASSGEN_DIGITS, + /* PASSGEN_SPECIAL PASSGEN_LETTERS_UP */ PASSGEN_LETTERS_LOW /* PASSGEN_DIGITS */, + /* PASSGEN_SPECIAL PASSGEN_LETTERS_UP */ PASSGEN_LETTERS_LOW PASSGEN_DIGITS, + /* PASSGEN_SPECIAL */ PASSGEN_LETTERS_UP /* PASSGEN_LETTERS_LOW PASSGEN_DIGITS */, + /* PASSGEN_SPECIAL */ PASSGEN_LETTERS_UP /* PASSGEN_LETTERS_LOW */ PASSGEN_DIGITS, + /* PASSGEN_SPECIAL */ PASSGEN_LETTERS_UP PASSGEN_LETTERS_LOW /* PASSGEN_DIGITS */, + /* PASSGEN_SPECIAL */ PASSGEN_LETTERS_UP PASSGEN_LETTERS_LOW PASSGEN_DIGITS, + PASSGEN_SPECIAL /* PASSGEN_LETTERS_UP PASSGEN_LETTERS_LOW PASSGEN_DIGITS */, + PASSGEN_SPECIAL /* PASSGEN_LETTERS_UP PASSGEN_LETTERS_LOW */ PASSGEN_DIGITS, + PASSGEN_SPECIAL /* PASSGEN_LETTERS_UP */ PASSGEN_LETTERS_LOW /* PASSGEN_DIGITS */, + PASSGEN_SPECIAL /* PASSGEN_LETTERS_UP */ PASSGEN_LETTERS_LOW PASSGEN_DIGITS, + PASSGEN_SPECIAL PASSGEN_LETTERS_UP /* PASSGEN_LETTERS_LOW PASSGEN_DIGITS */, + PASSGEN_SPECIAL PASSGEN_LETTERS_UP /* PASSGEN_LETTERS_LOW */ PASSGEN_DIGITS, + PASSGEN_SPECIAL PASSGEN_LETTERS_UP PASSGEN_LETTERS_LOW /* PASSGEN_DIGITS */, + PASSGEN_SPECIAL PASSGEN_LETTERS_UP PASSGEN_LETTERS_LOW PASSGEN_DIGITS, +}; + const int AlphabetLevels[] = {Digits, Lowercase, DigitsLower, DigitsAllLetters, Mixed}; const char* AlphabetLevelNames[] = {"1234", "abcd", "ab12", "Ab12", "Ab1#"}; const int AlphabetLevelsCount = sizeof(AlphabetLevels) / sizeof(int); @@ -45,21 +65,24 @@ typedef struct { Gui* gui; FuriMutex** mutex; NotificationApp* notify; + const char* alphabet; char password[PASSGEN_MAX_LENGTH + 1]; - // char alphabet[PASSGEN_CHARACTERS_LENGTH + 1]; - FuriString* alphabet; - int length; + int length; // must be <= PASSGEN_MAX_LENGTH int level; } PassGen; void state_free(PassGen* app) { + // NOTE: would have preferred if a "safe" memset() was available... + // but, since cannot prevent optimization from removing + // memset(), fill with random data instead. + furi_hal_random_fill_buf((void*)(app->password), PASSGEN_MAX_LENGTH); + gui_remove_view_port(app->gui, app->view_port); furi_record_close(RECORD_GUI); view_port_free(app->view_port); furi_message_queue_free(app->input_queue); furi_mutex_free(app->mutex); furi_record_close(RECORD_NOTIFICATION); - furi_string_free(app->alphabet); free(app); } @@ -101,17 +124,19 @@ static void render_callback(Canvas* canvas, void* ctx) { void build_alphabet(PassGen* app) { PassGen_Alphabet mode = AlphabetLevels[app->level]; - if((mode & Digits) != 0) furi_string_cat(app->alphabet, PASSGEN_DIGITS); - if((mode & Lowercase) != 0) furi_string_cat(app->alphabet, PASSGEN_LETTERS_LOW); - if((mode & Uppercase) != 0) furi_string_cat(app->alphabet, PASSGEN_LETTERS_UP); - if((mode & Special) != 0) furi_string_cat(app->alphabet, PASSGEN_SPECIAL); + if(mode > 0 && mode < 16) { + app->alphabet = PassGen_AlphabetChars[mode]; + } else { + app->alphabet = + PassGen_AlphabetChars[0]; // Invalid mode ... password will be all zero digits + } } PassGen* state_init() { PassGen* app = malloc(sizeof(PassGen)); + _Static_assert(8 <= PASSGEN_MAX_LENGTH, "app->length must be set <= PASSGEN_MAX_LENGTH"); app->length = 8; app->level = 2; - app->alphabet = furi_string_alloc(); build_alphabet(app); app->input_queue = furi_message_queue_alloc(8, sizeof(InputEvent)); app->view_port = view_port_alloc(); @@ -127,12 +152,46 @@ PassGen* state_init() { } void generate(PassGen* app) { - int hi = furi_string_size(app->alphabet); - for(int i = 0; i < app->length; i++) { - int x = rand() % hi; - app->password[i] = furi_string_get_char(app->alphabet, x); + memset(app->password, 0, PASSGEN_MAX_LENGTH + 1); + + int char_option_count = strlen(app->alphabet); + if(char_option_count < 0) { + return; + } + + // determine largest character value that avoids bias + char ceil = CHAR_MAX - (CHAR_MAX % char_option_count) - 1; + + // iteratively fill the password buffer with random values + // then keep only values that are in-range (no bias) + void* remaining_buffer = app->password; + size_t remaining_length = (app->length * sizeof(char)); + + while(remaining_length != 0) { + // fewer calls to hardware TRNG is more efficient + furi_hal_random_fill_buf(remaining_buffer, remaining_length); + + // keep only values that are in-range (no bias) + char* target = remaining_buffer; + char* source = remaining_buffer; + size_t valid_count = 0; + + for(size_t i = 0; i < remaining_length; i++) { + int v = *source; + // if the generated random value is in range, keep it + if(v < ceil) { + v %= char_option_count; + *target = app->alphabet[v]; + // increment target pointer and count of valid items found + target++; + valid_count++; + } + // always increment the source pointer + source++; + } + remaining_length -= valid_count; + remaining_buffer = target; } - app->password[app->length] = '\0'; } void update_password(PassGen* app, bool vibro) { diff --git a/applications/external/pomodoro/application.fam b/applications/external/pomodoro/application.fam index a96870e09..bd78edd5b 100644 --- a/applications/external/pomodoro/application.fam +++ b/applications/external/pomodoro/application.fam @@ -10,6 +10,6 @@ App( fap_icon="flipp_pomodoro_10.png", fap_author="@Th3Un1q3", fap_weburl="https://github.com/Th3Un1q3/flipp_pomodoro", - fap_version="1.1", + fap_version="1.2", fap_description="Boost Your Productivity with the Pomodoro Timer", ) diff --git a/applications/external/pomodoro/flipp_pomodoro_app.c b/applications/external/pomodoro/flipp_pomodoro_app.c index 70f065e8b..9235b14a3 100644 --- a/applications/external/pomodoro/flipp_pomodoro_app.c +++ b/applications/external/pomodoro/flipp_pomodoro_app.c @@ -11,14 +11,14 @@ static bool flipp_pomodoro_app_back_event_callback(void* ctx) { furi_assert(ctx); FlippPomodoroApp* app = ctx; return scene_manager_handle_back_event(app->scene_manager); -} +}; static void flipp_pomodoro_app_tick_event_callback(void* ctx) { furi_assert(ctx); FlippPomodoroApp* app = ctx; scene_manager_handle_custom_event(app->scene_manager, FlippPomodoroAppCustomEventTimerTick); -} +}; static bool flipp_pomodoro_app_custom_event_callback(void* ctx, uint32_t event) { furi_assert(ctx); @@ -33,7 +33,7 @@ static bool flipp_pomodoro_app_custom_event_callback(void* ctx, uint32_t event) case FlippPomodoroAppCustomEventStageComplete: if(flipp_pomodoro__get_stage(app->state) == FlippPomodoroStageFocus) { // REGISTER a deed on work stage complete to get an acheivement - // dolphin_deed(DolphinDeedPluginGameWin); + dolphin_deed(DolphinDeedPluginGameWin); FURI_LOG_I(TAG, "Focus stage reward added"); flipp_pomodoro_statistics__increase_focus_stages_completed(app->statistics); @@ -50,7 +50,7 @@ static bool flipp_pomodoro_app_custom_event_callback(void* ctx, uint32_t event) break; } return scene_manager_handle_custom_event(app->scene_manager, event); -} +}; FlippPomodoroApp* flipp_pomodoro_app_alloc() { FlippPomodoroApp* app = malloc(sizeof(FlippPomodoroApp)); @@ -89,7 +89,7 @@ FlippPomodoroApp* flipp_pomodoro_app_alloc() { scene_manager_next_scene(app->scene_manager, FlippPomodoroSceneTimer); FURI_LOG_I(TAG, "Alloc complete"); return app; -} +}; void flipp_pomodoro_app_free(FlippPomodoroApp* app) { view_dispatcher_remove_view(app->view_dispatcher, FlippPomodoroAppViewTimer); @@ -103,7 +103,7 @@ void flipp_pomodoro_app_free(FlippPomodoroApp* app) { free(app); furi_record_close(RECORD_GUI); furi_record_close(RECORD_NOTIFICATION); -} +}; int32_t flipp_pomodoro_app(void* p) { UNUSED(p); @@ -118,4 +118,4 @@ int32_t flipp_pomodoro_app(void* p) { flipp_pomodoro_app_free(app); return 0; -} +}; \ No newline at end of file diff --git a/applications/external/pomodoro/flipp_pomodoro_app.h b/applications/external/pomodoro/flipp_pomodoro_app.h index fab9b0f9c..de3812805 100644 --- a/applications/external/pomodoro/flipp_pomodoro_app.h +++ b/applications/external/pomodoro/flipp_pomodoro_app.h @@ -17,6 +17,7 @@ typedef enum { FlippPomodoroAppCustomEventStageSkip = 100, FlippPomodoroAppCustomEventStageComplete, // By Expiration FlippPomodoroAppCustomEventTimerTick, + FlippPomodoroAppCustomEventTimerAskHint, FlippPomodoroAppCustomEventStateUpdated, FlippPomodoroAppCustomEventResumeTimer, } FlippPomodoroAppCustomEvent; diff --git a/applications/external/pomodoro/flipp_pomodoro_app_i.h b/applications/external/pomodoro/flipp_pomodoro_app_i.h index c07968952..8b8650776 100644 --- a/applications/external/pomodoro/flipp_pomodoro_app_i.h +++ b/applications/external/pomodoro/flipp_pomodoro_app_i.h @@ -29,3 +29,4 @@ // Auto-compiled icons #include "flipp_pomodoro_icons.h" +#include diff --git a/applications/external/pomodoro/helpers/time.c b/applications/external/pomodoro/helpers/time.c index 02540a939..7fb0d13c2 100644 --- a/applications/external/pomodoro/helpers/time.c +++ b/applications/external/pomodoro/helpers/time.c @@ -7,7 +7,7 @@ const int TIME_MINUTES_IN_HOUR = 60; uint32_t time_now() { return furi_hal_rtc_get_timestamp(); -} +}; TimeDifference time_difference_seconds(uint32_t begin, uint32_t end) { const uint32_t duration_seconds = end - begin; @@ -17,4 +17,4 @@ TimeDifference time_difference_seconds(uint32_t begin, uint32_t end) { return ( TimeDifference){.total_seconds = duration_seconds, .minutes = minutes, .seconds = seconds}; -} +}; diff --git a/applications/external/pomodoro/modules/flipp_pomodoro.c b/applications/external/pomodoro/modules/flipp_pomodoro.c index cd417f791..0716e978e 100644 --- a/applications/external/pomodoro/modules/flipp_pomodoro.c +++ b/applications/external/pomodoro/modules/flipp_pomodoro.c @@ -18,9 +18,9 @@ PomodoroStage stages_sequence[] = { }; char* current_stage_label[] = { - [FlippPomodoroStageFocus] = "Continue focus for:", - [FlippPomodoroStageRest] = "Keep rest for:", - [FlippPomodoroStageLongBreak] = "Long Break for:", + [FlippPomodoroStageFocus] = "Focusing...", + [FlippPomodoroStageRest] = "Short Break...", + [FlippPomodoroStageLongBreak] = "Long Break...", }; char* next_stage_label[] = { @@ -38,22 +38,22 @@ void flipp_pomodoro__toggle_stage(FlippPomodoroState* state) { furi_assert(state); state->current_stage_index = state->current_stage_index + 1; state->started_at_timestamp = time_now(); -} +}; PomodoroStage flipp_pomodoro__get_stage(FlippPomodoroState* state) { furi_assert(state); return flipp_pomodoro__stage_by_index(state->current_stage_index); -} +}; char* flipp_pomodoro__current_stage_label(FlippPomodoroState* state) { furi_assert(state); return current_stage_label[flipp_pomodoro__get_stage(state)]; -} +}; char* flipp_pomodoro__next_stage_label(FlippPomodoroState* state) { furi_assert(state); return next_stage_label[flipp_pomodoro__stage_by_index(state->current_stage_index + 1)]; -} +}; void flipp_pomodoro__destroy(FlippPomodoroState* state) { furi_assert(state); @@ -68,22 +68,22 @@ uint32_t flipp_pomodoro__current_stage_total_duration(FlippPomodoroState* state) }; return stage_duration_seconds_map[flipp_pomodoro__get_stage(state)]; -} +}; uint32_t flipp_pomodoro__stage_expires_timestamp(FlippPomodoroState* state) { return state->started_at_timestamp + flipp_pomodoro__current_stage_total_duration(state); -} +}; TimeDifference flipp_pomodoro__stage_remaining_duration(FlippPomodoroState* state) { const uint32_t stage_ends_at = flipp_pomodoro__stage_expires_timestamp(state); return time_difference_seconds(time_now(), stage_ends_at); -} +}; bool flipp_pomodoro__is_stage_expired(FlippPomodoroState* state) { const uint32_t expired_by = flipp_pomodoro__stage_expires_timestamp(state); const uint8_t seamless_change_span_seconds = 1; return (time_now() - seamless_change_span_seconds) >= expired_by; -} +}; FlippPomodoroState* flipp_pomodoro__new() { FlippPomodoroState* state = malloc(sizeof(FlippPomodoroState)); @@ -91,4 +91,4 @@ FlippPomodoroState* flipp_pomodoro__new() { state->started_at_timestamp = now; state->current_stage_index = 0; return state; -} \ No newline at end of file +}; \ No newline at end of file diff --git a/applications/external/pomodoro/scenes/flipp_pomodoro_scene_timer.c b/applications/external/pomodoro/scenes/flipp_pomodoro_scene_timer.c index 20fb3c449..3f9511f70 100644 --- a/applications/external/pomodoro/scenes/flipp_pomodoro_scene_timer.c +++ b/applications/external/pomodoro/scenes/flipp_pomodoro_scene_timer.c @@ -8,6 +8,49 @@ enum { SceneEventConusmed = true, SceneEventNotConusmed = false }; +static char* work_hints[] = { + "Can you explain the problem as if I'm five?", + "Expected output vs. reality: what's the difference?", + "Ever thought of slicing the problem into bite-sized pieces?", + "What's the story when you walk through the code?", + "Any error messages gossiping about the issue?", + "What tricks have you tried to fix this?", + "Did you test the code, or just hoping for the best?", + "How's this code mingling with the rest of the app?", + "Any sneaky side effects causing mischief?", + "What are you assuming, and is it safe to do so?", + "Did you remember to invite all the edge cases to the party?", + "What happens in the isolation chamber (running code separately)?", + "Can you make the issue appear on command?", + "What's the scene at the crime spot when the error occurs?", + "Did you seek wisdom from the grand oracle (Google)?", + "What if you take a different path to solve this?", + "Did you take a coffee break to reboot your brain?"}; + +static char* break_hints[] = { + "Time to stretch! Remember, your body isn't made of code.", + "Hydrate or diedrate! Grab a glass of water.", + "Blink! Your eyes need a break too.", + "How about a quick dance-off with your shadow?", + "Ever tried chair yoga? Now's the time!", + "Time for a quick peek out the window. The outside world still exists!", + "Quick, think about kittens! Or puppies! Or baby turtles!", + "Time for a laugh. Look up a joke or two!", + "Sing a song. Bonus points for making up your own lyrics.", + "Do a quick tidy-up. A clean space is a happy space!", + "Time to play 'air' musical instrument for a minute.", + "How about a quick doodle? Unleash your inner Picasso!", + "Practice your superhero pose. Feel the power surge!", + "Quick, tell yourself a joke. Don't worry, I won't judge.", + "Time to practice your mime skills. Stuck in a box, anyone?", + "Ever tried juggling? Now's your chance!", + "Do a quick self high-five, you're doing great!"}; + +static char* random_string_of_list(char** hints, size_t num_hints) { + int random_index = rand() % num_hints; + return hints[random_index]; +} + void flipp_pomodoro_scene_timer_sync_view_state(void* ctx) { furi_assert(ctx); @@ -15,7 +58,7 @@ void flipp_pomodoro_scene_timer_sync_view_state(void* ctx) { flipp_pomodoro_view_timer_set_state( flipp_pomodoro_view_timer_get_view(app->timer_view), app->state); -} +}; void flipp_pomodoro_scene_timer_on_next_stage(void* ctx) { furi_assert(ctx); @@ -23,6 +66,12 @@ void flipp_pomodoro_scene_timer_on_next_stage(void* ctx) { FlippPomodoroApp* app = ctx; view_dispatcher_send_custom_event(app->view_dispatcher, FlippPomodoroAppCustomEventStageSkip); +}; + +void flipp_pomodoro_scene_timer_on_ask_hint(void* ctx) { + FlippPomodoroApp* app = ctx; + view_dispatcher_send_custom_event( + app->view_dispatcher, FlippPomodoroAppCustomEventTimerAskHint); } void flipp_pomodoro_scene_timer_on_enter(void* ctx) { @@ -37,23 +86,51 @@ void flipp_pomodoro_scene_timer_on_enter(void* ctx) { view_dispatcher_switch_to_view(app->view_dispatcher, FlippPomodoroAppViewTimer); flipp_pomodoro_scene_timer_sync_view_state(app); + + flipp_pomodoro_view_timer_set_callback_context(app->timer_view, app); + + flipp_pomodoro_view_timer_set_on_ok_cb( + app->timer_view, flipp_pomodoro_scene_timer_on_ask_hint); + flipp_pomodoro_view_timer_set_on_right_cb( - app->timer_view, flipp_pomodoro_scene_timer_on_next_stage, app); + app->timer_view, flipp_pomodoro_scene_timer_on_next_stage); +}; + +char* flipp_pomodoro_scene_timer_get_contextual_hint(FlippPomodoroApp* app) { + switch(flipp_pomodoro__get_stage(app->state)) { + case FlippPomodoroStageFocus: + return random_string_of_list(work_hints, sizeof(work_hints) / sizeof(work_hints[0])); + case FlippPomodoroStageRest: + case FlippPomodoroStageLongBreak: + return random_string_of_list(break_hints, sizeof(break_hints) / sizeof(break_hints[0])); + default: + return "What's up?"; + } } void flipp_pomodoro_scene_timer_handle_custom_event( FlippPomodoroApp* app, FlippPomodoroAppCustomEvent custom_event) { - if(custom_event == FlippPomodoroAppCustomEventTimerTick && - flipp_pomodoro__is_stage_expired(app->state)) { - view_dispatcher_send_custom_event( - app->view_dispatcher, FlippPomodoroAppCustomEventStageComplete); - } - - if(custom_event == FlippPomodoroAppCustomEventStateUpdated) { + switch(custom_event) { + case FlippPomodoroAppCustomEventTimerTick: + if(flipp_pomodoro__is_stage_expired(app->state)) { + view_dispatcher_send_custom_event( + app->view_dispatcher, FlippPomodoroAppCustomEventStageComplete); + } + break; + case FlippPomodoroAppCustomEventStateUpdated: flipp_pomodoro_scene_timer_sync_view_state(app); + break; + case FlippPomodoroAppCustomEventTimerAskHint: + flipp_pomodoro_view_timer_display_hint( + flipp_pomodoro_view_timer_get_view(app->timer_view), + flipp_pomodoro_scene_timer_get_contextual_hint(app)); + break; + default: + // optional: code to be executed if custom_event doesn't match any cases + break; } -} +}; bool flipp_pomodoro_scene_timer_on_event(void* ctx, SceneManagerEvent event) { furi_assert(ctx); @@ -68,10 +145,10 @@ bool flipp_pomodoro_scene_timer_on_event(void* ctx, SceneManagerEvent event) { return SceneEventConusmed; default: break; - } + }; return SceneEventNotConusmed; -} +}; void flipp_pomodoro_scene_timer_on_exit(void* ctx) { UNUSED(ctx); -} \ No newline at end of file +}; \ No newline at end of file diff --git a/applications/external/pomodoro/views/flipp_pomodoro_info_view.c b/applications/external/pomodoro/views/flipp_pomodoro_info_view.c index dab23ab9e..d42f1c2c1 100644 --- a/applications/external/pomodoro/views/flipp_pomodoro_info_view.c +++ b/applications/external/pomodoro/views/flipp_pomodoro_info_view.c @@ -6,6 +6,7 @@ #include "flipp_pomodoro_info_view.h" // Auto-compiled icons #include "flipp_pomodoro_icons.h" +#include enum { ViewInputConsumed = true, @@ -29,7 +30,7 @@ static void furi_string_printf( stats_string, - "So Long,\nand Thanks for All the Focus...\nand for completing\n%i pomodoro(s)", + "So Long,\nand Thanks for All the Focus...\nand for completing\n\e#%i\e# pomodoro(s)", model->pomodoros_completed); const char* stats_string_formatted = furi_string_get_cstr(stats_string); diff --git a/applications/external/pomodoro/views/flipp_pomodoro_timer_view.c b/applications/external/pomodoro/views/flipp_pomodoro_timer_view.c index eef96fcd1..b01bd5fe2 100644 --- a/applications/external/pomodoro/views/flipp_pomodoro_timer_view.c +++ b/applications/external/pomodoro/views/flipp_pomodoro_timer_view.c @@ -9,6 +9,7 @@ // Auto-compiled icons #include "flipp_pomodoro_icons.h" +#include enum { ViewInputConsumed = true, @@ -18,12 +19,15 @@ enum { struct FlippPomodoroTimerView { View* view; FlippPomodoroTimerViewInputCb right_cb; - void* right_cb_ctx; + FlippPomodoroTimerViewInputCb ok_cb; + void* callback_context; }; typedef struct { IconAnimation* icon; FlippPomodoroState* state; + size_t scroll_counter; + char* current_hint; } FlippPomodoroTimerViewModel; static const Icon* stage_background_image[] = { @@ -58,7 +62,7 @@ static void remaining_stage_time_string); furi_string_free(timer_string); -} +}; static void draw_str_with_drop_shadow( Canvas* canvas, @@ -89,10 +93,59 @@ static void flipp_pomodoro__current_stage_label(state)); } +static void + flipp_pomodoro_view_timer_draw_hint(Canvas* canvas, FlippPomodoroTimerViewModel* model) { + size_t MAX_SCROLL_COUNTER = 300; + uint8_t SCROLL_DELAY_FRAMES = 3; + + if(model->scroll_counter >= MAX_SCROLL_COUNTER || model->current_hint == NULL) { + return; + } + + uint8_t hint_width = 90; + uint8_t hint_height = 18; + + uint8_t hint_x = canvas_width(canvas) - hint_width - 6; + uint8_t hint_y = 35; + + FuriString* displayed_hint_string = furi_string_alloc(); + + furi_string_printf(displayed_hint_string, "%s", model->current_hint); + + size_t perfect_duration = furi_string_size(displayed_hint_string) * 1.5; + + if(model->scroll_counter > perfect_duration) { + model->scroll_counter = MAX_SCROLL_COUNTER; + furi_string_free(displayed_hint_string); + return; + } + + size_t scroll_offset = (model->scroll_counter < SCROLL_DELAY_FRAMES) ? + 0 : + model->scroll_counter - SCROLL_DELAY_FRAMES; + + canvas_set_color(canvas, ColorWhite); + canvas_draw_box(canvas, hint_x, hint_y, hint_width + 3, hint_height); + canvas_set_color(canvas, ColorBlack); + + elements_bubble(canvas, hint_x, hint_y, hint_width, hint_height); + + elements_scrollable_text_line( + canvas, + hint_x + 6, + hint_y + 12, + hint_width - 4, + displayed_hint_string, + scroll_offset, + true); + furi_string_free(displayed_hint_string); + model->scroll_counter++; +} + static void flipp_pomodoro_view_timer_draw_callback(Canvas* canvas, void* _model) { if(!_model) { return; - } + }; FlippPomodoroTimerViewModel* model = _model; @@ -105,34 +158,51 @@ static void flipp_pomodoro_view_timer_draw_callback(Canvas* canvas, void* _model canvas, flipp_pomodoro__stage_remaining_duration(model->state)); flipp_pomodoro_view_timer_draw_current_stage_label(canvas, model->state); + canvas_set_color(canvas, ColorBlack); canvas_set_font(canvas, FontSecondary); elements_button_right(canvas, flipp_pomodoro__next_stage_label(model->state)); -} + flipp_pomodoro_view_timer_draw_hint(canvas, model); +}; bool flipp_pomodoro_view_timer_input_callback(InputEvent* event, void* ctx) { furi_assert(ctx); furi_assert(event); FlippPomodoroTimerView* timer = ctx; - const bool should_trigger_right_event_cb = (event->type == InputTypePress) && - (event->key == InputKeyRight) && - (timer->right_cb != NULL); + const bool is_press_event = event->type == InputTypePress; - if(should_trigger_right_event_cb) { - furi_assert(timer->right_cb); - furi_assert(timer->right_cb_ctx); - timer->right_cb(timer->right_cb_ctx); - return ViewInputConsumed; + if(!is_press_event) { + return ViewInputNotConusmed; } - return ViewInputNotConusmed; -} + switch(event->key) { + case InputKeyRight: + timer->right_cb(timer->callback_context); + return ViewInputConsumed; + case InputKeyOk: + timer->ok_cb(timer->callback_context); + return ViewInputConsumed; + default: + return ViewInputNotConusmed; + } +}; View* flipp_pomodoro_view_timer_get_view(FlippPomodoroTimerView* timer) { furi_assert(timer); return timer->view; +}; + +void flipp_pomodoro_view_timer_display_hint(View* view, char* hint) { + with_view_model( + view, + FlippPomodoroTimerViewModel * model, + { + model->scroll_counter = 0; + model->current_hint = hint; + }, + true); } void flipp_pomodoro_view_timer_assign_animation(View* view) { @@ -140,7 +210,6 @@ void flipp_pomodoro_view_timer_assign_animation(View* view) { view, FlippPomodoroTimerViewModel * model, { - furi_assert(model->state); if(model->icon) { icon_animation_free(model->icon); } @@ -160,30 +229,57 @@ FlippPomodoroTimerView* flipp_pomodoro_view_timer_alloc() { flipp_pomodoro_view_timer_get_view(timer), ViewModelTypeLockFree, sizeof(FlippPomodoroTimerViewModel)); + view_set_context(flipp_pomodoro_view_timer_get_view(timer), timer); view_set_draw_callback(timer->view, flipp_pomodoro_view_timer_draw_callback); view_set_input_callback(timer->view, flipp_pomodoro_view_timer_input_callback); + with_view_model( + flipp_pomodoro_view_timer_get_view(timer), + FlippPomodoroTimerViewModel * model, + { model->scroll_counter = 0; }, + false); + return timer; +}; + +void flipp_pomodoro_view_timer_set_callback_context( + FlippPomodoroTimerView* timer, + void* callback_ctx) { + furi_assert(timer); + furi_assert(callback_ctx); + timer->callback_context = callback_ctx; } void flipp_pomodoro_view_timer_set_on_right_cb( FlippPomodoroTimerView* timer, - FlippPomodoroTimerViewInputCb right_cb, - void* right_cb_ctx) { + FlippPomodoroTimerViewInputCb right_cb) { + furi_assert(timer); furi_assert(right_cb); - furi_assert(right_cb_ctx); timer->right_cb = right_cb; - timer->right_cb_ctx = right_cb_ctx; +}; + +void flipp_pomodoro_view_timer_set_on_ok_cb( + FlippPomodoroTimerView* timer, + FlippPomodoroTimerViewInputCb ok_kb) { + furi_assert(ok_kb); + furi_assert(timer); + timer->ok_cb = ok_kb; } void flipp_pomodoro_view_timer_set_state(View* view, FlippPomodoroState* state) { furi_assert(view); furi_assert(state); with_view_model( - view, FlippPomodoroTimerViewModel * model, { model->state = state; }, false); + view, + FlippPomodoroTimerViewModel * model, + { + model->state = state; + model->current_hint = NULL; + }, + false); flipp_pomodoro_view_timer_assign_animation(view); -} +}; void flipp_pomodoro_view_timer_free(FlippPomodoroTimerView* timer) { furi_assert(timer); @@ -195,4 +291,4 @@ void flipp_pomodoro_view_timer_free(FlippPomodoroTimerView* timer) { view_free(timer->view); free(timer); -} \ No newline at end of file +}; \ No newline at end of file diff --git a/applications/external/pomodoro/views/flipp_pomodoro_timer_view.h b/applications/external/pomodoro/views/flipp_pomodoro_timer_view.h index 929a0eba3..d5b0ac2a6 100644 --- a/applications/external/pomodoro/views/flipp_pomodoro_timer_view.h +++ b/applications/external/pomodoro/views/flipp_pomodoro_timer_view.h @@ -15,7 +15,16 @@ void flipp_pomodoro_view_timer_free(FlippPomodoroTimerView* timer); void flipp_pomodoro_view_timer_set_state(View* view, FlippPomodoroState* state); +void flipp_pomodoro_view_timer_set_callback_context( + FlippPomodoroTimerView* timer, + void* callback_ctx); + void flipp_pomodoro_view_timer_set_on_right_cb( FlippPomodoroTimerView* timer, - FlippPomodoroTimerViewInputCb right_cb, - void* right_cb_ctx); + FlippPomodoroTimerViewInputCb right_cb); + +void flipp_pomodoro_view_timer_set_on_ok_cb( + FlippPomodoroTimerView* timer, + FlippPomodoroTimerViewInputCb ok_cb); + +void flipp_pomodoro_view_timer_display_hint(View* view, char* hint); diff --git a/applications/external/qrcode/qrcode_app.c b/applications/external/qrcode/qrcode_app.c index c605c249e..c0c27af16 100644 --- a/applications/external/qrcode/qrcode_app.c +++ b/applications/external/qrcode/qrcode_app.c @@ -7,7 +7,8 @@ #include // this file is generated by the build script -#include +#include "qrcode_icons.h" +#include #include "qrcode.h" #define TAG "qrcode" @@ -549,81 +550,82 @@ int32_t qrcode_app(void* p) { } InputEvent input; - while(furi_message_queue_get(instance->input_queue, &input, FuriWaitForever) == - FuriStatusOk) { - furi_check(furi_mutex_acquire(instance->mutex, FuriWaitForever) == FuriStatusOk); + while(1) { + if(furi_message_queue_get(instance->input_queue, &input, 100) == FuriStatusOk) { + furi_check(furi_mutex_acquire(instance->mutex, FuriWaitForever) == FuriStatusOk); - if(input.key == InputKeyBack) { - if(instance->message) { - furi_string_free(instance->message); - instance->message = NULL; - } - if(instance->qrcode) { - qrcode_free(instance->qrcode); - instance->qrcode = NULL; - } - instance->loading = true; - instance->edit = false; - furi_mutex_release(instance->mutex); - break; - } else if(input.key == InputKeyRight) { - instance->show_stats = true; - } else if(input.key == InputKeyLeft) { - instance->show_stats = false; - } else if(instance->show_stats && !instance->loading && instance->qrcode) { - if(input.key == InputKeyUp) { - if(!instance->edit) { - instance->selected_idx = MAX(0, instance->selected_idx - 1); - } else { - if(instance->selected_idx == 0 && - instance->set_version < MAX_QRCODE_VERSION) { - instance->set_version++; - } else if(instance->selected_idx == 1) { - uint8_t max_ecc = instance->set_version == instance->min_version ? - instance->max_ecc_at_min_version : - ECC_HIGH; - if(instance->set_ecc < max_ecc) { - instance->set_ecc++; - } - } + if(input.key == InputKeyBack) { + if(instance->message) { + furi_string_free(instance->message); + instance->message = NULL; } - } else if(input.key == InputKeyDown) { - if(!instance->edit) { - instance->selected_idx = MIN(1, instance->selected_idx + 1); - } else { - if(instance->selected_idx == 0 && - instance->set_version > instance->min_version) { - instance->set_version--; - if(instance->set_version == instance->min_version) { - instance->set_ecc = - MAX(instance->set_ecc, instance->max_ecc_at_min_version); - } - } else if(instance->selected_idx == 1 && instance->set_ecc > 0) { - instance->set_ecc--; - } + if(instance->qrcode) { + qrcode_free(instance->qrcode); + instance->qrcode = NULL; } - } else if(input.key == InputKeyOk) { - if(instance->edit && (instance->set_version != instance->qrcode->version || - instance->set_ecc != instance->qrcode->ecc)) { - QRCode* qrcode = instance->qrcode; - instance->loading = true; - - if(rebuild_qrcode(instance, instance->set_version, instance->set_ecc)) { - qrcode_free(qrcode); + instance->loading = true; + instance->edit = false; + furi_mutex_release(instance->mutex); + break; + } else if(input.key == InputKeyRight) { + instance->show_stats = true; + } else if(input.key == InputKeyLeft) { + instance->show_stats = false; + } else if(instance->show_stats && !instance->loading && instance->qrcode) { + if(input.key == InputKeyUp) { + if(!instance->edit) { + instance->selected_idx = MAX(0, instance->selected_idx - 1); } else { - FURI_LOG_E(TAG, "Could not rebuild qrcode"); - instance->qrcode = qrcode; - instance->set_version = qrcode->version; - instance->set_ecc = qrcode->ecc; + if(instance->selected_idx == 0 && + instance->set_version < MAX_QRCODE_VERSION) { + instance->set_version++; + } else if(instance->selected_idx == 1) { + uint8_t max_ecc = instance->set_version == instance->min_version ? + instance->max_ecc_at_min_version : + ECC_HIGH; + if(instance->set_ecc < max_ecc) { + instance->set_ecc++; + } + } } + } else if(input.key == InputKeyDown) { + if(!instance->edit) { + instance->selected_idx = MIN(1, instance->selected_idx + 1); + } else { + if(instance->selected_idx == 0 && + instance->set_version > instance->min_version) { + instance->set_version--; + if(instance->set_version == instance->min_version) { + instance->set_ecc = + MAX(instance->set_ecc, instance->max_ecc_at_min_version); + } + } else if(instance->selected_idx == 1 && instance->set_ecc > 0) { + instance->set_ecc--; + } + } + } else if(input.key == InputKeyOk) { + if(instance->edit && (instance->set_version != instance->qrcode->version || + instance->set_ecc != instance->qrcode->ecc)) { + QRCode* qrcode = instance->qrcode; + instance->loading = true; - instance->loading = false; + if(rebuild_qrcode(instance, instance->set_version, instance->set_ecc)) { + qrcode_free(qrcode); + } else { + FURI_LOG_E(TAG, "Could not rebuild qrcode"); + instance->qrcode = qrcode; + instance->set_version = qrcode->version; + instance->set_ecc = qrcode->ecc; + } + + instance->loading = false; + } + instance->edit = !instance->edit; } - instance->edit = !instance->edit; } - } - furi_mutex_release(instance->mutex); + furi_mutex_release(instance->mutex); + } view_port_update(instance->view_port); } diff --git a/applications/external/rc2014_coleco/coleco.c b/applications/external/rc2014_coleco/coleco.c index 311b0ceac..2d32777d3 100644 --- a/applications/external/rc2014_coleco/coleco.c +++ b/applications/external/rc2014_coleco/coleco.c @@ -3,6 +3,7 @@ #include #include #include "coleco_icons.h" +#include #define CODE_0 0x0A #define CODE_1 0x0D diff --git a/applications/external/reversi/application.fam b/applications/external/reversi/application.fam index 5401bc489..25a087c0c 100644 --- a/applications/external/reversi/application.fam +++ b/applications/external/reversi/application.fam @@ -14,6 +14,6 @@ App( fap_icon_assets_symbol="game_reversi", fap_author="@dimat", fap_weburl="https://github.com/zyuhel/flipperzero-racegame", - fap_version="1.0", + fap_version="1.1", fap_description="Reversi game, the game controls should be intuitive. Longs press on OK opens the menu to start a new game.", ) diff --git a/applications/external/reversi/game_reversi.c b/applications/external/reversi/game_reversi.c index 9b0802706..407f80f8b 100644 --- a/applications/external/reversi/game_reversi.c +++ b/applications/external/reversi/game_reversi.c @@ -315,7 +315,7 @@ int32_t game_reversi_app() { (app_state.game.current_player != app_state.game.human_color)) { computer_move(&app_state.game); } - FuriStatus event_status = furi_message_queue_get(event_queue, &input, FuriWaitForever); + FuriStatus event_status = furi_message_queue_get(event_queue, &input, 100); if(event_status == FuriStatusOk) { // handle only press event, ignore repeat/release events @@ -335,6 +335,7 @@ int32_t game_reversi_app() { view_port_update(view_port); furi_mutex_release(app_state.mutex); } + view_port_update(view_port); } gui_remove_view_port(gui, view_port); diff --git a/applications/external/rootoflife/roots_of_life_game.c b/applications/external/rootoflife/roots_of_life_game.c index 1fbee225e..7b5d67ef0 100644 --- a/applications/external/rootoflife/roots_of_life_game.c +++ b/applications/external/rootoflife/roots_of_life_game.c @@ -7,6 +7,7 @@ #include #include "roots_of_life_game_icons.h" +#include #define TAG "RootsOfLife" diff --git a/applications/external/simonsays/images/DolphinNiceLeft_96x59.png b/applications/external/simonsays/images/DolphinNiceLeft_96x59.png new file mode 100644 index 000000000..a299d3630 Binary files /dev/null and b/applications/external/simonsays/images/DolphinNiceLeft_96x59.png differ diff --git a/applications/external/simonsays/simon_says.c b/applications/external/simonsays/simon_says.c index 724b1e607..a583ff115 100644 --- a/applications/external/simonsays/simon_says.c +++ b/applications/external/simonsays/simon_says.c @@ -12,7 +12,7 @@ #include /* generated by fbt from .png files in images folder */ -#include +#include "simon_says_icons.h" #include #define TAG "Simon" // Used for logging diff --git a/applications/external/slots/application.fam b/applications/external/slots/application.fam index 7821bdc91..190841543 100644 --- a/applications/external/slots/application.fam +++ b/applications/external/slots/application.fam @@ -12,6 +12,6 @@ App( fap_icon_assets="assets", fap_author="@Daniel-dev-s", fap_weburl="https://github.com/Daniel-dev-s/flipperzero-slots", - fap_version="1.0", + fap_version="1.1", fap_description="Simple Slots simulator game", ) diff --git a/applications/external/slots/slotmachine.c b/applications/external/slots/slotmachine.c index c8eb270d6..fa85b99ba 100644 --- a/applications/external/slots/slotmachine.c +++ b/applications/external/slots/slotmachine.c @@ -5,7 +5,8 @@ #include #include #include -#include +#include "slotmachine_icons.h" +#include const Icon* slot_frames[] = {&I_x2, &I_x3, &I_x4, &I_x2_2, &I_x5}; @@ -222,42 +223,46 @@ int32_t slotmachine_app(void* p) { InputEvent input; // endless input cycle - while(furi_message_queue_get(slotmachine->input_queue, &input, FuriWaitForever) == - FuriStatusOk) { - // if thread idle - take it - furi_check(furi_mutex_acquire(slotmachine->model_mutex, FuriWaitForever) == FuriStatusOk); + while(1) { + if(furi_message_queue_get(slotmachine->input_queue, &input, 100) == FuriStatusOk) { + // if thread idle - take it + furi_check( + furi_mutex_acquire(slotmachine->model_mutex, FuriWaitForever) == FuriStatusOk); - if(!checkIsSpinning(slotmachine)) { - if(input.key == InputKeyBack) { - // exit on back button - furi_mutex_release(slotmachine->model_mutex); - break; - } else if(input.key == InputKeyOk && input.type == InputTypeShort && slotmachine->winview) { - slotmachine->winview = false; - } else if( - input.key == InputKeyOk && input.type == InputTypeShort && - slotmachine->bet <= slotmachine->money) { - COLUMNS_COUNT = rand() % 3 + 2; - slotmachine->money -= slotmachine->bet; - slotmachine->columns[0]->spining = true; + if(!checkIsSpinning(slotmachine)) { + if(input.key == InputKeyBack) { + // exit on back button + furi_mutex_release(slotmachine->model_mutex); + break; + } else if( + input.key == InputKeyOk && input.type == InputTypeShort && + slotmachine->winview) { + slotmachine->winview = false; + } else if( + input.key == InputKeyOk && input.type == InputTypeShort && + slotmachine->bet <= slotmachine->money) { + COLUMNS_COUNT = rand() % 3 + 2; + slotmachine->money -= slotmachine->bet; + slotmachine->columns[0]->spining = true; - for(int i = 0; i < COLUMNS_COUNT; i++) { - slotmachine->columns[i]->times = DEFAULT_SPINNING_TIMES; - slotmachine->columns[i]->speed = DEFAULT_SPEED; - } - } else if(input.key == InputKeyUp) { - if(slotmachine->bet + 10 < slotmachine->money) { - slotmachine->bet += 10; - } - } else if(input.key == InputKeyDown) { - if(slotmachine->bet - 10 > 0) { - slotmachine->bet -= 10; + for(int i = 0; i < COLUMNS_COUNT; i++) { + slotmachine->columns[i]->times = DEFAULT_SPINNING_TIMES; + slotmachine->columns[i]->speed = DEFAULT_SPEED; + } + } else if(input.key == InputKeyUp) { + if(slotmachine->bet + 10 < slotmachine->money) { + slotmachine->bet += 10; + } + } else if(input.key == InputKeyDown) { + if(slotmachine->bet - 10 > 0) { + slotmachine->bet -= 10; + } } } - } - // release thread - furi_mutex_release(slotmachine->model_mutex); + // release thread + furi_mutex_release(slotmachine->model_mutex); + } // redraw viewport view_port_update(slotmachine->view_port); } diff --git a/applications/external/t_rex_runner/application.fam b/applications/external/t_rex_runner/application.fam index 99cb0f19a..843ea307d 100644 --- a/applications/external/t_rex_runner/application.fam +++ b/applications/external/t_rex_runner/application.fam @@ -12,6 +12,6 @@ App( order=36, fap_author="@Rrycbarm", fap_weburl="https://github.com/Rrycbarm/t-rex-runner", - fap_version="1.0", - fap_description="Port of Chrome browser running T-rex game", + fap_version="1.2", + fap_description="Play the port of the Chrome browser T-Rex game on your Flipper Zero.", ) diff --git a/applications/external/t_rex_runner/trexrunner.c b/applications/external/t_rex_runner/trexrunner.c index d7db91fad..a1351a4ce 100644 --- a/applications/external/t_rex_runner/trexrunner.c +++ b/applications/external/t_rex_runner/trexrunner.c @@ -8,6 +8,7 @@ #include #include "t_rex_runner_icons.h" +#include #define DINO_START_X 10 #define DINO_START_Y 34 // 64 - 22 - BACKGROUND_H / 2 - 2 @@ -192,6 +193,17 @@ static void game_state_init(GameState* const game_state) { game_state->mutex = furi_mutex_alloc(FuriMutexTypeNormal); } +static void game_state_reinit(GameState* const game_state) { + game_state->last_tick = furi_get_tick(); + game_state->y_acceleration = game_state->y_speed = 0; + game_state->y_position = DINO_START_Y; + game_state->has_cactus = 0; + game_state->background_position = 0; + game_state->lost = 0; + game_state->x_speed = START_x_speed; + game_state->score = 0; +} + int32_t trexrunner_app() { FuriMessageQueue* event_queue = furi_message_queue_alloc(8, sizeof(PluginEvent)); @@ -218,7 +230,7 @@ int32_t trexrunner_app() { gui_add_view_port(gui, view_port, GuiLayerFullscreen); PluginEvent event; - for(bool processing = true; processing && !game_state->lost;) { + for(bool processing = true; processing;) { FuriStatus event_status = furi_message_queue_get(event_queue, &event, 100); if(event_status == FuriStatusOk) { // press events @@ -234,6 +246,10 @@ int32_t trexrunner_app() { case InputKeyRight: break; case InputKeyOk: + if(game_state->lost) { + game_state_reinit(game_state); + break; + } if(game_state->y_position == DINO_START_Y) game_state->y_speed = JUMP_SPEED; break; @@ -246,13 +262,6 @@ int32_t trexrunner_app() { } } } - } else { - // event timeout - ; - } - if(game_state->lost) { - furi_message_queue_get( - event_queue, &event, 1500); //Sleep to show the "you lost" message } view_port_update(view_port); furi_mutex_release(game_state->mutex); diff --git a/applications/external/tama_p1/tama_p1.c b/applications/external/tama_p1/tama_p1.c index f098aa157..476665059 100644 --- a/applications/external/tama_p1/tama_p1.c +++ b/applications/external/tama_p1/tama_p1.c @@ -8,6 +8,7 @@ #include "tamalib/tamalib.h" #include "tama.h" #include "compiled/assets_icons.h" +#include TamaApp* g_ctx; FuriMutex* g_state_mutex; diff --git a/applications/external/tanksgame/tanks_game.c b/applications/external/tanksgame/tanks_game.c index a32721a82..f9befdc71 100644 --- a/applications/external/tanksgame/tanks_game.c +++ b/applications/external/tanksgame/tanks_game.c @@ -10,7 +10,8 @@ #include #include #include -#include +#include "tanks_icons.h" +#include #include "helpers/radio_device_loader.h" #include "constants.h" diff --git a/applications/external/text2sam/application.fam b/applications/external/text2sam/application.fam index d7d0e42eb..5598df644 100644 --- a/applications/external/text2sam/application.fam +++ b/applications/external/text2sam/application.fam @@ -16,6 +16,6 @@ App( order=20, fap_author="@Round-Pi & (Fixes by @Willy-JL)", fap_weburl="https://github.com/Round-Pi/flipperzero-text2sam", - fap_version="1.0", - fap_description="Enter text and hear it spoken by SAM (Software Automatic Mouth)", + fap_version="1.1", + fap_description="Convert text to speech on your Flipper Zero with SAM (Software Automatic Mouth).", ) diff --git a/applications/external/timelapse/application.fam b/applications/external/timelapse/application.fam index cd1e2c408..6dc6a3bc4 100644 --- a/applications/external/timelapse/application.fam +++ b/applications/external/timelapse/application.fam @@ -10,7 +10,7 @@ App( fap_icon_assets="icons", fap_icon="zeitraffer.png", fap_category="GPIO", - fap_version="1.0", + fap_version="1.1", fap_description="Simple intervalometer app, works via GPIO pins.", fap_author="Aurelius Rosenbaum", fap_weburl="https://github.com/theageoflove/flipperzero-zeitraffer", diff --git a/applications/external/timelapse/zeitraffer.c b/applications/external/timelapse/zeitraffer.c index 859d256ee..7e5e4c116 100644 --- a/applications/external/timelapse/zeitraffer.c +++ b/applications/external/timelapse/zeitraffer.c @@ -326,6 +326,7 @@ int32_t zeitraffer_app(void* p) { } } } + view_port_update(view_port); } // Наше событие — это сработавший таймер @@ -379,6 +380,8 @@ int32_t zeitraffer_app(void* p) { default: notification_message(notifications, &sequence_display_backlight_enforce_auto); } + + view_port_update(view_port); } if(Time < 1) Time = 1; // Не даём открутить таймер меньше единицы if(Count < -1) diff --git a/applications/external/totp/application.fam b/applications/external/totp/application.fam index 4d9fe4634..8debade2c 100644 --- a/applications/external/totp/application.fam +++ b/applications/external/totp/application.fam @@ -4,15 +4,7 @@ App( apptype=FlipperAppType.EXTERNAL, entry_point="totp_app", cdefines=["APP_TOTP"], - requires=[ - "gui", - "cli", - "dialogs", - "storage", - "input", - "notification", - "bt" - ], + requires=["gui", "cli", "dialogs", "storage", "input", "notification", "bt"], stack_size=2 * 1024, order=20, fap_version="2.3", diff --git a/applications/external/yatzee/application.fam b/applications/external/yatzee/application.fam index 5885082f1..f633d8102 100644 --- a/applications/external/yatzee/application.fam +++ b/applications/external/yatzee/application.fam @@ -6,7 +6,7 @@ App( requires=["gui"], stack_size=4 * 1024, order=99, - fap_icon="yatzee_icon_10px.png", + fap_icon="images/yatzee_icon_10px.png", fap_category="Games", fap_icon_assets="images", fap_author="@emfleak", diff --git a/applications/external/yatzee/yatzee_icon_10px.png b/applications/external/yatzee/images/yatzee_icon_10px.png similarity index 100% rename from applications/external/yatzee/yatzee_icon_10px.png rename to applications/external/yatzee/images/yatzee_icon_10px.png