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

[wiring] Fix SPI macros polluting global namespace #2089

Merged
merged 4 commits into from Apr 28, 2020

Conversation

avtolstoy
Copy link
Member

Problem

SPI, SPI1 and SPI2 are defines in wiring. Such generic macro names pollute the global namespace and easily cause issue e.g. #2077

Solution

Add a proxy class that would delegate the calls to actual wiring SPI objects, while still maintaining singleton-like static initialization of them.

This PR also updates SPI API tests, as they have not been complete.

Steps to Test

  • wiring/api
  • wiring/no_fixture
  • wiring/no_fixture_spi
  • #2077 should work

Example App

N/A

References

  • Closes #2077

Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@avtolstoy avtolstoy added this to the 1.5.1 milestone Apr 28, 2020
@avtolstoy avtolstoy requested a review from sergeuz April 28, 2020 17:17
@avtolstoy avtolstoy changed the title Fix/spi macros global namespace [wiring] Fix SPI macros polluting global namespace Apr 28, 2020
@avtolstoy avtolstoy merged commit 7ece97d into develop Apr 28, 2020
@avtolstoy avtolstoy deleted the fix/spi-macros-global-namespace branch April 28, 2020 17:57
@avtolstoy avtolstoy modified the milestones: 1.5.1, 2.0.0 Apr 28, 2020
@avtolstoy avtolstoy added ready to merge PR has been reviewed and tested and removed needs review labels Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ready to merge PR has been reviewed and tested
Projects
None yet
2 participants