-
Notifications
You must be signed in to change notification settings - Fork 600
Make LibGpiodDriver V2 driver public #2386
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
Merged
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
bd04378
Clean up LibGpiodDriver interface
pgrawehr 36d12ee
Provide new GpioChipInfo static method
pgrawehr 73d3791
Undo previous change
pgrawehr f6c93ca
Revert "Clean up LibGpiodDriver interface"
pgrawehr deee7f0
Revert to old behavior: LibgpiodDriver is V1, V2 is separate
pgrawehr 51a9931
This was now doubled
pgrawehr 13bb848
Add test for SysFs
pgrawehr 106323b
Implement method
pgrawehr 831cea2
Why does this not fit?
pgrawehr 2dab36c
Something is strange here
pgrawehr eed3ece
There's a bug here
pgrawehr 5fd5272
Better now?
pgrawehr 364fd45
Provide implementation for LibgpiodV1
pgrawehr 9aa4959
Need to debug this
pgrawehr c568085
Avoid crash, maybe?
pgrawehr cffd647
Could be working
pgrawehr ae2658a
No duplicates here
pgrawehr 747e778
Why is that crashing?
pgrawehr cca6685
Disable this test, because it seems it does now crash
pgrawehr 9356a87
Something crashes very ugly here
pgrawehr accbef1
Make sure this test is the culprit
pgrawehr e934b50
Revert previous change
pgrawehr 278edb4
Maybe not closing the stuff avoids the crash
pgrawehr 896a074
No crashes any more?
pgrawehr dd9fc5f
Chip info for V2 completed
pgrawehr 0ecf0ff
Add Test for V2
pgrawehr ef00529
Minor fix
pgrawehr f6d1082
Fix #2384: Avoid exception when toggling a pin whose current value is…
pgrawehr 4b3525c
Stylecop error fixed
pgrawehr 9d33c73
Improve parsing
pgrawehr 3c76e01
This should be the right pattern
pgrawehr d7f7012
Try to make it work on RPI3, too
pgrawehr 8d627b9
Something behaves differently on the RPI3
pgrawehr 6d34f83
Stupid me
pgrawehr 4d611d9
Is a directory
pgrawehr 761af06
Cleanup
pgrawehr fef36a8
Use new method to fix a TODO
pgrawehr a9f1a7d
Make it more clear how this handle is used
pgrawehr 18f51af
Review findings
pgrawehr 119e847
Adjust namespaces
pgrawehr d13bde4
That didn't compile
pgrawehr a921b74
Mark new stuff experimental for now
pgrawehr e56f9fb
Include ChipInfo in QueryComponentInformation
pgrawehr 4a32169
Some more review findings
pgrawehr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,14 +11,16 @@ namespace System.Device.Gpio.Libgpiod.V1; | |
/// </summary> | ||
internal class SafeChipIteratorHandle : SafeHandle | ||
{ | ||
public SafeChipIteratorHandle() | ||
: base(IntPtr.Zero, true) | ||
public SafeChipIteratorHandle(IntPtr handle) | ||
: base(handle, true) | ||
{ | ||
} | ||
|
||
protected override bool ReleaseHandle() | ||
{ | ||
LibgpiodV1.gpiod_chip_iter_free(handle); | ||
// We can't close the chip here, as this would possibly result in it being freed twice, which causes a crash | ||
LibgpiodV1.gpiod_chip_iter_free_noclose(handle); | ||
handle = IntPtr.Zero; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
return true; | ||
} | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.