Skip to content

[Linux]: use shared pin FD cache#1027

Merged
2bndy5 merged 1 commit intomasterfrom
irq-caching
May 3, 2025
Merged

[Linux]: use shared pin FD cache#1027
2bndy5 merged 1 commit intomasterfrom
irq-caching

Conversation

@2bndy5
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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