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

Re-export each pin type aliases (PA0, PA1, ..) under gpio module #236

Closed
Piroro-hs opened this issue Jun 8, 2021 · 3 comments
Closed

Re-export each pin type aliases (PA0, PA1, ..) under gpio module #236

Piroro-hs opened this issue Jun 8, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@Piroro-hs
Copy link
Contributor

Piroro-hs commented Jun 8, 2021

Pros:

  • less typings
  • remove redundancy of gpio::gpioa::PA0

Cons:

  • Super long "Re-exports" section in rustdoc
@Sh3Rm4n
Copy link
Member

Sh3Rm4n commented Jun 8, 2021

Generally in favor of your suggestion.

But what about directly defining these type aliases in the gpio module, instead of the gpio::gpioX module. Does this mitigate the "Re-export" con?

stm32f3xx-hal/src/gpio.rs

Lines 912 to 913 in 2a4382e

/// Partially erased pin
pub type $PXx<Mode> = Pin<$Gpiox, Ux, Mode>;

@Sh3Rm4n Sh3Rm4n added the enhancement New feature or request label Jun 8, 2021
@Piroro-hs
Copy link
Contributor Author

Piroro-hs commented Jun 8, 2021

Super long too but maybe fair enough😃.
However, should we keep gpio::gpioX::PXn for compatibility?

@Sh3Rm4n
Copy link
Member

Sh3Rm4n commented Jun 8, 2021

However, should we keep gpio::gpioX::PXn for compatibility?

Hm. 🤔 I don't know? Maybe because this is subtle difference to the other stm32xxxx hal implementations? But maybe not? It is definitely a big change for everyone upgrading a version.

What about a slight conversation phase? Keep them in the old place for one version while introducing the new place and in the version after that remove them?

After I'm finally about to release 0.7 I'll hope to increase the release cadence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants