-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Arduino SDK 1.6 compatibility #174
Open
JonasProgrammer
wants to merge
36
commits into
queezythegreat:master
Choose a base branch
from
JonasProgrammer:feature/arduino16-compatibility
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Added Arduino SDK 1.6 compatibility #174
JonasProgrammer
wants to merge
36
commits into
queezythegreat:master
from
JonasProgrammer:feature/arduino16-compatibility
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JonasProgrammer
commented
May 5, 2017
- incorporated patch to fix library- and compiler detection in newer arduino sdk versions (huge thanks to @thx8411 for providing the patch in Arduino SDK 1.5 Support #55 (comment))
- fixed variables getting lost during compiler detection by storing them temporarily in environment
- added auto-discovery via "ARDUINO_SDK_PATH" environment variable, so the path doesn't have to be set individually for each project, if the sdk is installed to a non-standard location
- incorporated patch to fix library- and compiler detection in newer arduino sdk versions (huge thanks to @thx8411 for providing the patch in queezythegreat#55 (comment)) - fixed variables getting lost during compiler detection by storing them temporarily in environment - added auto-discovery via "ARDUINO_SDK_PATH" environment variable, so the path doesn't have to be set individually for each project, if the sdk is installed to a non-standard location
- fixed errornous path for detection - trailing /src is no longer used for library names - -> libraries detected correctly now - prevent self-linking cmake warning
…STER_HARDWARE_PLATFORM' function.
… to the 'LOAD_ARDUINO_STYLE_SETTINGS' function. This function loads all settings of all boards defined in the 'boards.txt' file.
…st of available CPUs for a given board. This list will be used later to automatically define arguments, based on their matching architecture.
…ith regards to the new 1.6 SDK modifications.
…E files (currently working with CLion).
This is made to process a 2000-lines long file quicker, since there are no special navigating tools for CMake files. It's especially compatible with the CLion IDE, which offers to collapse selected blocks of plain text into unnamed regions.
… the Arduino 1.6 SDK. Board's cpu architecture (mcu) must be defined through the variable 'board.build.mcu' for this feature to work. Also changed the example a bit to test it against the new feature.
… the Arduino 1.6 SDK. Board's cpu architecture (mcu) must be defined through the variable 'board.build.mcu' for this feature to work.
Added support for board settings (menu-based) in the 1.6 SDK (thx @MrPointer)
…eature/arduino16-compatibility
Now you can generate examples from the 'examples' directory, such as the classic 'blink' example, using the command 'generate_arduino_example', setting the 'LIBRARY' variable to the name of the parent directory of the example, such as '01.Basics' for the 'Blink' example. Also added a demo for it in the example CMakeLists.txt file.
Added a new command named 'GENERATE_ARDUINO_EXAMPLE', which does the same as generating examples for libraries except it is optimized for built-in examples. Added a new function named 'setup_arduino_example' which finds an example and generates a sketch for it. This function can be optimized by passing an optional parameter which specifies the 'Category' of the example, meaning its parent directory, such as 'Basics' is for 'Blink'. Currently only the 'xx.Example_Name' model is supported (Two-digits used).
It means that both SDKs that add a leading '0' to the index of an example's category (in single-digit indices), and those that don't, are successfully parsed. As this commit may be a bit unclear, an example is the 'Blink' Arduino example: Its category is named 'Basics', yet some SDKs define it in their path as '01.Basics' and some as '1.Basics'.
…ORIES'. This variable stores a list of the loaded example categories. Documented the 'load_arduino_examples' function.
Modified the 'find_arduino_libraries' function to perform better and return actual results when the libraries to search for are known in advance. Modified the setup functions 'setup_arduino_libraries' and 'setup_arduino_library' to actually setup the library, correcting a few bugs that were present before, mostly regarding false variables passed to functions. Added a new example to test the code, will be removed later or integrated to the current examples. ###Note There is still work to do! There are a lot of untested scenarios to worry about!
The function 'Generate_cpp_from_sketch' appears damaged, creating a source file that can't be built correctly due to various function redefinitions. Added a new version named 'generate_sketch_cpp', which seems to resolve this issue. Also modified the command 'GENERATE_ARDUINO_LIBRARY_EXAMPLE' to perform better and adapt the new 'generate_cpp_sketch' function. ## Note This change might by *deadly*, since the only sketch that has been tested is the one defined in the examples of this project - Others might require further processing. If it's the case, let the developers know!
…- Accidentally removed some lines 2 commits earlier, which may be valuable. Removed unnecessary debug messages, turned off the arduino_debug switch.
Modified the regex that searches for the category's alphabetical name in the 'load_arduino_examples_categories' function. Also fixed some variable names that were have been renamed but not updated in their usage. Modified the 'INCREMENT_EXAMPLE_CATEGORY_INDEX' macro to set the output variable locally, and not in the PARENT_SCOPE as it is a macro.
…s) to the `blink_example` target.
Listed some changes regarding *arduino examples*. Added self and [Jonas](https://github.com/JonasProgrammer) to the contributors list. Replaced the link to the repository with a link to [Jonas's Fork](https://github.com/JonasProgrammer/arduino-cmake), honoring the original repository as well.
Added support for built-in examples and libraries
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.