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

peripherals type alias #555

Closed
djdisodo opened this issue May 30, 2024 · 2 comments · Fixed by #559
Closed

peripherals type alias #555

djdisodo opened this issue May 30, 2024 · 2 comments · Fixed by #559

Comments

@djdisodo
Copy link

djdisodo commented May 30, 2024

i think peripherals type names are hard to write and remember currently,

it makes some problem because rust requires you to put type on generic parameters, function arguments or static/const values

for example how can tell what's type of pin d9 on UNO is? atmega_hal::port::PB1

however names should be different depending on the board

first, maybe we can introduce some macro that parses given value and return the type

iirc this is used in syn with token! macro

or we can just create type alias

@Rahix
Copy link
Owner

Rahix commented Jun 8, 2024

for example how can tell what's type of pin d9 on UNO is? atmega_hal::port::PB1

This is a good point. I think the avr_hal_generic::renamed_pins! {} macro should generate type aliases for the pins at least. This also shouldn't be too difficult to achieve.

@Rahix
Copy link
Owner

Rahix commented Jun 8, 2024

(Created #558 to track this)

LuigiPiucco added a commit to LuigiPiucco/avr-hal that referenced this issue Jun 9, 2024
LuigiPiucco added a commit to LuigiPiucco/avr-hal that referenced this issue Jun 9, 2024
LuigiPiucco added a commit to LuigiPiucco/avr-hal that referenced this issue Jun 10, 2024
Rahix pushed a commit that referenced this issue Jun 10, 2024
A very simple improvement to fix #558 and fix #555.
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 a pull request may close this issue.

2 participants