Repository navigation
Seed3 DevKits - #717
Merged
Merged
Seed3 DevKits#717
Conversation
…r non-GPIO objects), included in daisy.h
…t Hardware class.
Collaborator
Author
|
I'll look into the (seemingly unrelated?) cmake-gcc build error, and see if it has anything to do with the change to C++17. If it does, I'll separate that version bump from this PR, and we can revisit that later. |
…vel constexpr for each devkit.
…o desktop devkit to match other boards.
Collaborator
Author
|
Okay -- something weird w/ the C++17 was seeming to cause a build error during the build-cmake-gcc build with 9-2020-q2. Also, since the dev kits are all namespaced, it is a bit cleaner to use the consts as: So I've moved those back to just being namespaced constexprs, and i'll look into doing a C++ standard update sometime later. |
This file contains hidden or 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
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.
Adds support for the upcoming Seed3 DevKits, and updates default library build settings to use C++17 instead of C++14.
These are similar to the wrappers for the kickstarter products (pod, patch, petal, field) with a few notable differences in structure:
Each class is simply named,
Hardwareand scoped within a namespace for that devkit (e.g.desktop_devkit::Hardware)This is to make the process of moving firmware from one platform to another require a few less edits, and match up with common patterns in custom HW projects.
The API for each devkit is much more minimal. The common methods (e.g.
Init(),UpdateAllControls()) are still provided, but there is an expectation that members (e.g. pots, switches, etc.) will be accessed directly. This reduces the code footprint, and again, makes adapting programs from the devkits to custom hardware require fewer changes and/or boilerplate.The library was updated to build with C++17 (we may bump it up to C++20 later, as well).
This has been something requested for a few language features.
In the case of the devkits, the only c++17 feature being used are for the inline constexpr values for the quantity of pots, etc. (e.g.
inline static constexpr size_t kNumPots = 8;).This, in my opinion, is the most legible way to have these scoped within the class while still having the value obvious to users/readers.
Accompanying the new hardware support classes, are a few new examples: