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

Add batch read-write methods for GPIO #2148

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

HumJ0218
Copy link
Contributor

@HumJ0218 HumJ0218 commented Oct 15, 2023

for #2147

The original public void Write(ReadOnlySpan<PinValuePair> pinValuePairs) and public void Read(Span<PinValuePair> pinValuePairs) in GpioController were moved to GpioDriver, and were made overrideable to support a more efficient batch read-write method implementation in specific GPIO driver classes.

Microsoft Reviewers: Open in CodeFlow

@ghost ghost added the area-System.Device.Gpio Contains types for using general-purpose I/O (GPIO) pins label Oct 15, 2023
Copy link
Contributor

@pgrawehr pgrawehr 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 from an implementation point of view, but this has broken the test suite. Could get a bit nasty to fix, because Span<T> cannot be part of a method that is mocked.

src/System.Device.Gpio/System/Device/Gpio/GpioDriver.cs Outdated Show resolved Hide resolved
@ghost ghost added the Needs: Author Feedback We are waiting for author to react to feedback (action required) label Oct 15, 2023
@ghost ghost removed the Needs: Author Feedback We are waiting for author to react to feedback (action required) label Oct 16, 2023
Copy link
Contributor

@pgrawehr pgrawehr 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. We'll discuss it in the next team meeting.

Copy link
Member

@Ellerbach Ellerbach 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. Once merge, I can definitely get some perf improvements for the FT family as well.

@pgrawehr
Copy link
Contributor

Helix tests are still failing.

The baseline comparison tests can be ignored for now, that's easy to clarify and fix.

@HumJ0218
Copy link
Contributor Author

HumJ0218 commented Oct 23, 2023

I'm a bit puzzled about this compilation error.

Why would the "protected internal" of the base class be considered as "public" in the compilation process, causing the compilation error CP0019?

@pgrawehr
Copy link
Contributor

@HumJ0218 Can you show exactly what change causes this? Also, are you sure you meant CP0019? I cannot find this error code. What exactly is reported?

@HumJ0218
Copy link
Contributor Author

@HumJ0218 Can you show exactly what change causes this? Also, are you sure you meant CP0019? I cannot find this error code. What exactly is reported?

https://dev.azure.com/dotnet/IoT/_build/results?buildId=99483&view=logs&j=fa59fe4e-195c-56fa-189b-58fd241f10dd&t=afa1ce5e-d2bc-56f3-ad78-7883f25a3e3a&l=874

@pgrawehr
Copy link
Contributor

pgrawehr commented Oct 24, 2023

Oh, that. That's just our compatibility check. It verifies that the build doesn't break backwards compatibility against the previous release. Since changing a method from public to protected is a breaking change, it complains. In this case, I think we're fine with accepting that breaking change and you can update the configuration accordingly. Run the following command to automatically update the suppressions for this warning:

build -pack /p:GenerateCompatibilitySuppressionFile=true

It should update the file src\Iot.Device.Bindings\CompatibilitySuppressions.xml.

@Ellerbach
Copy link
Member

[Triage] @HumJ0218 is the use case still valid? If yes, can you please address the conflict and adjust the different elements? If no, we will close the PR which can anyway always been reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Device.Gpio Contains types for using general-purpose I/O (GPIO) pins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants