Skip to content
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

Adding support for custom boards in the cli #183

Merged
merged 3 commits into from
Dec 22, 2019

Conversation

JordiChauzi
Copy link
Contributor

Fixes #97

This PR allows to provide a custom board specification in the CLI, eg:

avrgirl-arduino flash -f Blink.cpp.hex -a custom.json

This change being in the CLI part, I am not sure what is the appropriate way to test it.

There is currently not a lot of documentation for custom boards (looking at you #151), so I did not add documentation on the expected JSON format. The only tricky part, I think, is the signature field where we create the Buffer from the input JSON array. Maybe adding a CLI option to display the JSON specification for a supported board may help ?

Maybe we want to the feature to the library part? It may make sense to handle the Buffer creation for the user.

I tried to provide an accurate error message, but using the same argument, it is kind of hard to discriminate between a board name and a JSON file.

@coveralls
Copy link

coveralls commented Dec 3, 2019

Coverage Status

Coverage increased (+0.8%) to 45.357% when pulling 0c94880 on JordiChauzi:cli-custom-board into 6ed8d25 on noopkat:master.

@noopkat
Copy link
Owner

noopkat commented Dec 8, 2019

hey @JordiChauzi this new feature is awesome and I love the code and error messages!

I think you were right to point out the issue of the board spec technically being invalid JSON. What I'm going to propose is to switch to a .js file instead, and document (in the README) the general idea of how to create this file. We can point the user to the custom board section of the README rather than reinvent the wheel so they can learn how to do this. What do you think?

@noopkat noopkat self-requested a review December 9, 2019 19:16
Copy link
Owner

@noopkat noopkat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for making these changes! I'm ready to merge and release these changes if you're comfortable with that!

@JordiChauzi
Copy link
Contributor Author

hey @JordiChauzi this new feature is awesome and I love the code and error messages!

I think you were right to point out the issue of the board spec technically being invalid JSON. What I'm going to propose is to switch to a .js file instead, and document (in the README) the general idea of how to create this file. We can point the user to the custom board section of the README rather than reinvent the wheel so they can learn how to do this. What do you think?

Yep, this seems logical.
I have changed the custom file to a JavaScript file. I have implemented a simple solution to export the board (ie. module.exports = board;). Tell me if you want something different!

@JordiChauzi
Copy link
Contributor Author

thanks for making these changes! I'm ready to merge and release these changes if you're comfortable with that!

All is good on my side!

@noopkat
Copy link
Owner

noopkat commented Dec 22, 2019

whoops! Sorry for dropping the ball on this! Merging and releasing in a new version now 👀
Thanks again for adding this much needed feature 😄 🎉

bitmoji

@noopkat noopkat merged commit a9e911b into noopkat:master Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support json file on command line for custom board
3 participants