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

"_begin"-function is public #21

Merged
merged 6 commits into from
Nov 26, 2021
Merged

"_begin"-function is public #21

merged 6 commits into from
Nov 26, 2021

Conversation

Adminius
Copy link
Contributor

for more flexibility declare _begin as public

allows experienced user use almost any pin.

Example:
_begin(&sercom4, SERCOM4, SERCOM4_DMAC_ID_TX, 22, SPI_PAD_0_SCK_3, PIO_SERCOM_ALT);

Based on discussion in #1, #5, #14 , #17

P.S. we can also rename _begin to begin...

for more flexibility declare _begin as public
@PaintYourDragon
Copy link
Contributor

The only explanation I can find for why there’s a protected _begin() function comes from a note with commit #10 that it “ought not be called by anyone.” Apparently there’s a legit use case, and I seem to vaguely recall us even using it somewhere, so maybe that wasn’t the best choice.

Also prior to #10, it appeared as an overloaded case of begin(), not a distinct _begin() function. I’m all for restoring the original behavior — a special overloaded begin() case, not a separate _begin(). Most folks will never even know the special case exists and would go on using the stock begin(), advanced folks can use the special variant.

Yes, all cases of boolean can be replaced with bool now. boolean was an oldschool Arduino compatibility thing and is no longer needed.

clang-format seems to be complaining about a single blank line that can be deleted, see “Details” accompanying the build process above.

@Adminius
Copy link
Contributor Author

Adminius commented Nov 25, 2021

Hi @PaintYourDragon, I've made changes according to your suggestions.

@Adminius
Copy link
Contributor Author

@ladyada are you ok with this PR?

@ladyada ladyada merged commit ec4898c into adafruit:master Nov 26, 2021
@ladyada
Copy link
Member

ladyada commented Nov 26, 2021

sure!

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.

None yet

3 participants