-
Notifications
You must be signed in to change notification settings - Fork 148
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
Update Daisy board definitions to use new Pin system #581
Update Daisy board definitions to use new Pin system #581
Conversation
Thanks for the contribution! I think everything looks good here. Re. the gate outputs I've been trying to decide how to manage the same change for the GPIO output on the PatchSM (via #561) |
Yeah, that makes sense. I'd be more than happy to do the other boards at the same time in this PR for completions sake if that'd be okay? I just have no way of physically testing them. |
Oh, is the style CI a transformer automatically applied to the PR, or do I need to make changes to the relevant commit to have it match the CI output? Edit: I've just gone ahead and amended the commit after running clang-format on the document. Don't know why I forgot to do that in the first place. |
2f7ee10
to
42ef585
Compare
42ef585
to
bb63023
Compare
This updates the patch_sm class to use the new Pin objects, which necessitated restructuring the pin definitions in the header file in a way that now exposes them similarly to the daisy::seed namespace, and removes the need for the now-deprecated GetPin method.
b508d8a
to
5c30e60
Compare
I've taken the liberty to adapt the rest of the board objects to Pin definitions, most of which is self-explanatory in the code. This is all part of a larger (completed) rework to globally use GPIO and Pin, currently at stellar-aria:feature/global_gpio_migration that depends on the commits here. |
Thanks for going above and beyond! For all of the It looks like there was an issue with the conversion of the PatchSM pins, based on the CI build failing. If you'd like you can integrate the changes in #561 here, or revert the PatchSM in this PR, and leave it to be handled in that PR. Re. the gate outputs: Regardless, we should be be finished with tests on Monday, and be ready to merge it. |
This fixes breaking API changes due to the move of Pin definitions outside of DaisyPatchSM, by putting them back, albeit as constexpr definitions in the header file. kPinMap is still marked as deprecated when GetPin is removed.
Sorry, that was a mistake on my part, I had a different version locally with the pins as static members similar to the previous version that I just pushed up. Are there plans to move Also, just a heads up that it looks like the repo's style linter is somehow following I think moving to Pin/GPIO throughout the library probably constitutes a large enough API change that might be worth a major version update. A good chunk of the examples still compile, but others such as patch/Sequencer still use things like Heck or the GPIO change could be a minor version update, and the cleanup could be part of the major release? Anyways, I'll open a PR for those changes once this one closes. |
I actually like this idea a lot. Definitely would have to be a part of a major version update since it will require all previous code to change, albeit a simple change. Brief history for context: libDaisy started out in C, and prior to the release of the Daisy shifted to C++, but a lot of the "guts", and earliest components of the library have stuck to the older conventions.
Hmm, I don't think that is intentional, but missing quotes might explain the occasional mismatch between local clang-format runs, and the CI script. Re. the proposition to excise the I also like this idea, and I think it would be a good step toward some much-needed house keeping throughout the library. As a first step in that we are actively working on a documentation site for the entire Daisy Ecosystem (both hardware, and software). An initial version of that will likely be live in the next month or two. So with that said, I think for now let's aim to keep backwards compatibility with these changes, and then revisit some of the larger changes in the coming months. In other news, we're a good chunk of the way through doing a validation test with the hardware on this PR. Only ones left to check are the Petal, Versio, and Legio. |
@stellar-aria Alright! Testing completed. Aside from the remaining style changes, this is ready to merge. 🚀 |
@stephenhensley Completed! |
Okay! Merging now. |
Hi! I just got a Daisy Patch a few days ago, and while I was creating a variant of the Daisy Patch class I noticed the original didn't use any of the new
Pin
system.This seemed like a nice easy way to begin contributing, so I simply replaced all the pin macros with
constexpr
definitions and replaced the references accordingly. I did a simple test with the Patch's Sequencer program and it worked, for what that's worth.This could be folded into a larger PR for doing this for all the boards, and I'd be more than happy to do so, but I only have the hardware to test things for the Patch and Seed.
Additionally, the
dsy_gpio gate_output
in the class could be replaced with a newerGPIO
object, but that would be a breaking API change and I don't know what the procedures are for that/when it would be appropriate.