Skip to content

fix compatibility with differing /sys/bus/gpio/devices/gpiochip* #967

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 15, 2025

Conversation

mrossington
Copy link
Contributor

When using a USB to Serial cable I note that initialising the blinka library would crash. I'd receive an error saying that it cannot open the file /sys/bus/gpio/devices/gpiochip14/of_node/compatible. This was because the FTDI cable had added an additional gpioChip which didn't have the expected path structure.

I feel like it's safe to add an is_file() check to this path before opening and this does make the issue go away on my setup.

Please let me know if there are:

  • Coding standards I may have missed
  • Tests that I need to run and ensure I haven't broken
  • A better way to handle this

Additionally, is it worth looking if we do this sort of blind read elsewhere and fix those too? Could then add a generic function.

Copy link
Collaborator

@makermelissa makermelissa left a comment

Choose a reason for hiding this comment

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

Sounds good. Hopefully this fixes #966.

@makermelissa makermelissa merged commit 8f45d6c into adafruit:main May 15, 2025
1 check passed
@mrossington mrossington deleted the mrossington-lgpio-bug branch May 15, 2025 16:23
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.

2 participants