Skip to content

[Linux]: use shared pin FD cache #1027

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 1 commit into from
May 3, 2025
Merged

[Linux]: use shared pin FD cache #1027

merged 1 commit into from
May 3, 2025

Conversation

2bndy5
Copy link
Member

@2bndy5 2bndy5 commented Apr 15, 2025

resolves #1026

@2bndy5 2bndy5 changed the title use shared pin FD cache [Linux]: use shared pin FD cache Apr 16, 2025
@2bndy5 2bndy5 marked this pull request as ready for review May 1, 2025 01:06
@2bndy5
Copy link
Member Author

2bndy5 commented May 1, 2025

I realize now that this lib has no need for digitalRead(). I discovered this in developing another lib that does use digitalRead() (on an IRQ pin) and uses a similar version of this SPIDEV code... I'm just submitting it here in case any users get clever enough to

pinMode(IRQ_PIN, INPUT);
attachInterrupt(IRQ_PIN, FALLING, &isrFunc);
bool isInactive = GPIO::read(IRQ_PIN);

on Linux with the SPIDEV driver.

@2bndy5 2bndy5 requested a review from TMRh20 May 3, 2025 00:05
Copy link
Member

@TMRh20 TMRh20 left a comment

Choose a reason for hiding this comment

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

Tested & functional on RPi4 & 5

@2bndy5 2bndy5 merged commit 6210312 into master May 3, 2025
19 checks passed
@2bndy5 2bndy5 deleted the irq-caching branch May 3, 2025 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linux attachInterrupt() causes GPIO::read() to fail
2 participants