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] spi: an attempt to bring back compatibility with SPIClass #2095

Merged
merged 1 commit into from May 6, 2020

Conversation

avtolstoy
Copy link
Member

Problem

A number of libraries rely on the internals of our wiring SPI implementation (SPIClass). After introducing a proxy class in #2089, we inadvertently broke them.

Solution

As a workaround we can introduce implicit conversion operator to the proxy class to convert to SPIClass&, as well as operator& overload to be able to convert a proxy instance to SPIClass*. This is not ideal, but pretty much the simplest thing we can do.

Steps to Test

  • Test affected libraries/projects e.g. LIS3DH
  • wiring/api

Example App

N/A

References


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)

Copy link

@rickkas7 rickkas7 left a comment

Choose a reason for hiding this comment

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

Looks good to me. I tested Adafruit_SSD1306_RK that uses SPIClass* and LIS3DH that uses SPIClass& with both with and without my 1.5.1-rc.1 workaround on the fix/spi-proxy-compatibility branch and everything compiled correctly for me.

@avtolstoy avtolstoy merged commit 0eac601 into develop May 6, 2020
@avtolstoy avtolstoy deleted the fix/spi-proxy-compatibility branch May 6, 2020 16:35
@avtolstoy avtolstoy added ready to merge PR has been reviewed and tested and removed needs review labels May 6, 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