Rahix / avr-hal-template

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

Optionally generate boilerplate for UART console #17

Open Rahix opened 1 year ago

Rahix commented 1 year ago

I'm very unsure where we should go this route, but I want to at least raise the possibility.

This PR adds a new prompt during project generation which asks the user whether they want additional boilerplate for a UART console in their project. This can of course be extended for other devices like I2C, SPI, panic handlers, etc.

One one hand, it would make starting a new project a bit faster. On the other, it means additional effort to keep the template up-to-date and has the chance of people just enabling everything "because maybe I'll need it" and then leaving the code sitting in their project unused. Not sure if we want to enable that...

In any case, I think this PR needs to wait until https://github.com/cargo-generate/cargo-generate/issues/885 is resolved.

brainstorm commented 5 months ago

On the one hand I agree that putting in too much lines of code is not neat, but on the other hand I think that it'd instantly solve issues like mine because it's a tested template?

I.e: https://github.com/Rahix/avr-hal/discussions/530

Rahix commented 5 months ago

For instance, I'm confused with the Usart+ufmt behavior on my Atmega2560, see this output in the commit message: brainstorm/embassy-as5600@a37b9b5

Please ask about this in the Discussions of avr-hal, then we can take a closer look.