-
Notifications
You must be signed in to change notification settings - Fork 202
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
Tier one common examples #529
Conversation
) -> ( | ||
bsp::hal::clock::GenericClockController, | ||
bsp::RedLed, | ||
UsbBusAllocator<UsbBus>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to make these all Option<T>
's, but for some reason it didn't work properly when I tried. Need to figure this out especially if we'll be vending out things like Timer
's and RTC
's
Option<bsp::RedLed>, | ||
Option<UsbBusAllocator<UsbBus>>, | ||
) { | ||
let mut clocks = bsp::hal::clock::GenericClockController::with_external_32kosc( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to have an enum argument for external_32k
/internal_32k
/etc.
No offence, but this looks overly complicated which kind of defeats the purpose of the examples as a demonstration of how to get started with a board. |
Fair criticism, I can see that perspective. I didn't think it was too bad but it might be enough to obscure things too much for people wanting to copy-paste get started on their project. Any other opinions? |
It might work better if you have separate |
Also, I wouldn't try to abstract away the initialization code. Better to leave that in each example, even if it's redundant. It lets each example stand on its own, and it shows new users how to properly initialize. Edit: Let me revise that. If you want to abstract some of the clocking, then I would do it in each individual BSP, and use a common name (e.g. |
Thanks for the feedback. I think I'll close this for now and maybe revisit once |
Summary
Unify common examples for tier one BSPs to reduce code duplication.
Checklist
CHANGELOG.md
for the BSP or HAL updated