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

Adds support for Adafruit's Trinket M0 #1172

Merged
merged 1 commit into from
Oct 31, 2021

Conversation

jgressmann
Copy link
Contributor

Adds support for Adafruit's Trinket M0 board.

Also adds initial support for UART for the board family.

//--------------------------------------------------------------------+
// UART support
//--------------------------------------------------------------------+
TU_ATTR_WEAK void uart_init(void);
Copy link
Owner

Choose a reason for hiding this comment

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

since we always defined uart_init(), why would we use weak function here. Are you planning to allow application to overwrite this ? Otherwise I think we could just simply remove the weak attribute

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, exactly. The Trinket M0 only has very few pins / pads available for external hardware components.
In fact, I would argue it would make sense to make board_init() a weak function so users can easily replace it if need to.

Copy link
Owner

Choose a reason for hiding this comment

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

it only makes sense if this repo providing board abstraction for application. Unfortunately, I have no intention to do so. The whole bsp and examples in this repo is only used to demonstrate how tinyusb API is used, and prove and test that it works on hardware. These can be changed completely without any notices.

Sum up application and user should write their own bsp init code for their own board. Therefore please remove the weak attribute in the function.

Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

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

superb! Thank you very much for the PR.

@hathach hathach merged commit fa3ed60 into hathach:master Oct 31, 2021
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.

2 participants