Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

gpio(adaptors): fix so now gpiodev is used as default #1112

Merged
merged 1 commit into from
Jan 4, 2025

Conversation

gen2thomas
Copy link
Collaborator

@gen2thomas gen2thomas commented Jan 3, 2025

Solved issues and/or description of the change

#1109

This means:

  • using the gpiod implementation is now the default for new platforms
  • behavior can be changed by the user with "adaptors.WithSysfsAccess()"
  • platforms which do not have translation maps for gpiod are forced to use the legacy sysfs, so this is a compatible change
  • unit tests for gpiod pins can use the "system.UseMockDigitalPinAccess()"

Additionally:

  • switch from "Optioner" to "Applier" implementation for digital pin options
  • simplify analog pin definition map a bit
  • increase test coverage

Manual test

  • OS and Version (Win/Mac/Linux): Linux
  • Adaptor(s) and/or driver(s):
    • Nanopi NEO (gpiod) - example "nanopi_direct_pin.go"
    • PocketBeagle (sysfs) - new example "beaglepocket_direct_pin.go"

Checklist

  • The PR's target branch is 'hybridgroup:dev'
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes (e.g. by run make test_race)
  • No linter errors exist locally (e.g. by run make fmt_check)
  • I have performed a self-review of my own code

@gen2thomas gen2thomas force-pushed the fix/gpiodev_tests branch 8 times, most recently from b578374 to 4529812 Compare January 4, 2025 10:21
@gen2thomas gen2thomas marked this pull request as ready for review January 4, 2025 10:59
@gen2thomas gen2thomas merged commit 6aaccc1 into hybridgroup:dev Jan 4, 2025
6 checks passed
@gen2thomas gen2thomas deleted the fix/gpiodev_tests branch January 4, 2025 11:08
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant