Adjust periphery implementation to not set GPIO V2 real-time flag#43
Open
theshaun wants to merge 1 commit intorightup:feat/newRadiosfrom
Open
Adjust periphery implementation to not set GPIO V2 real-time flag#43theshaun wants to merge 1 commit intorightup:feat/newRadiosfrom
theshaun wants to merge 1 commit intorightup:feat/newRadiosfrom
Conversation
…OCK_REALTIME in order to support older kernals without the need for gpiod
Owner
|
Well this is a brilliant find! |
Author
|
Have had this running on some boards for a while with no dramas. I feel this is save to use, but happy to add a flag to enact this if that seems better |
Owner
|
My only thought is.. would it be an issue when we add multiple radios, I started looking at a way to auto detect version but ran out of time.
Sent from Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Shaun Walker ***@***.***>
Sent: Saturday, March 14, 2026 8:02:01 AM
To: rightup/pyMC_core ***@***.***>
Cc: Lloyd ***@***.***>; Comment ***@***.***>
Subject: Re: [rightup/pyMC_core] Adjust periphery implementation to not set GPIO V2 real-time flag (PR #43)
[https://avatars.githubusercontent.com/u/712995?s=20&v=4]theshaun left a comment (rightup/pyMC_core#43)<#43 (comment)>
Have had this running on some boards for a while with no dramas. I feel this is save to use, but happy to add a flag to enact this if that seems better
—
Reply to this email directly, view it on GitHub<#43 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACM32JOIW7UW2PPYQOO63D34QUGXTAVCNFSM6AAAAACWKFWF5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DANJZHE3TGNZTHE>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Author
|
I don't believe it should. I did consider if we had kernel detection. but given some vendors cherry pick it might be present somewhere in a version we don't think it would be (slim though). When multi radio is added, is it anticipated to need real time output of GPIO state? |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
After further digging at the core issue with older kernels I discovered that the root cause relates to GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME being set when edge detection is used
https://github.com/vsergeev/python-periphery/blob/master/periphery/gpio_cdev2.py#L261C13-L261C19
GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME seems to have been added into the linux kernel in 5.16 or so. A lot of Rockchip boards still use 5.10.~
Given we do not seem to need timestamps for the interrupts its not necessary to have this flag set. And given that python-periphery is not actively maintained (it seems) it is easier to make the change here for our use case, but i'll update an existing issue upstream to see if there is a way they can implement a fix.
I expect that after some longer testing, we may be able to remove the gpiod implementation I added previously as this will allow luckfox and other rockchip devices to just use python-periphery