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

Update SPIDEV driver for Character Device v2 ABI; cache FDs #959

Merged
merged 7 commits into from
Mar 13, 2024

Conversation

2bndy5
Copy link
Member

@2bndy5 2bndy5 commented Mar 11, 2024

  • uses Linux Kernel's Character Device v2 ABI instead of the deprecated v1 ABI
  • caches the File Descriptors used to control GPIO pins

@2bndy5
Copy link
Member Author

2bndy5 commented Mar 11, 2024

I still want to test the caching of FDs. Specifically,

  • does not break other apps that use the same /dev/gpiochipX when RF24 app is running
  • still works when dynamically init-ing pins with RF24::begin() instead of c'tor

I'm opening this PR as the solution for #943 will be separate from these changes implemented for non-IRQ GPIO usage.

utility/SPIDEV/gpio.cpp Outdated Show resolved Hide resolved
@2bndy5 2bndy5 marked this pull request as ready for review March 12, 2024 22:49
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.

Haven't tested everything, but looks like you've been thorough.

Works like a charm!

The new install script with automated selection for branches is prettynice to have now too for testing stuff.

This should allow for easier code reuse when implementing a similar cache for interrupts
@2bndy5
Copy link
Member Author

2bndy5 commented Mar 13, 2024

The new install script with automated selection for branches is prettynice to have now too for testing stuff.

I think it would be helpful to have it git pull --rebase after git checkout <branch/tag>. That way you don't have to contend with installing from branches that are already checked out locally but have force-pushed updates on the remote.


Anyway. Yeah, I'm ready to merge this and move on to #943. I've been testing it pretty thoroughly (even in my local pyRF24 cloned repo).

@2bndy5 2bndy5 merged commit 05efe34 into master Mar 13, 2024
31 checks passed
@2bndy5 2bndy5 deleted the char-dev-v2-ABI branch March 13, 2024 10:46
@TMRh20
Copy link
Member

TMRh20 commented Mar 13, 2024

Cool, been running this on all my RPis overnight as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants