Rahix / avr-hal-template

cargo-generate template for avr-hal projects
Apache License 2.0
130 stars 28 forks source link

include a serial and adc object to the template #5

Closed mutantbob closed 1 year ago

mutantbob commented 2 years ago

While the focus of this template is mostly providing the AVR scaffolding, I feel that the main.rs could benefit from a couple of more examples of how to create objects to access important peripherals. By referencing them here, a new coder will more quickly learn what to search for in the more detailed examples.

Rahix commented 2 years ago

Hi, thanks for the PR!

To be quite honest, I would like to keep the template as minimal as possible. From my experience, people will leave all code from a template in, even if they don't need it. By not including any superflous code we can help code quality of downstreams users a bit and also force them to think a bit more about the things they want to do...

For helping people find the code-snippets they need to achieve certain things, I had the comment in main.rs in mind:

https://github.com/Rahix/avr-hal-template/blob/d330f45b6dd1ae0aae17f574742b42e83a5de53f/src/main.rs#L11-L19

But maybe that is poorly worded/doesn't yield the intended result? If you have ideas how to improve it, please tell!

Rahix commented 1 year ago

Hi, I'll close this PR for now, but if you feel that this is something we should talk about again, let me know.