Skip to content

bcm283x: Issue 62 Change bcm283x to use ioctl for GPIO pins, not sysfs.#63

Merged
maruel merged 9 commits intoperiph:mainfrom
gsexton:bcm283x
Oct 21, 2024
Merged

bcm283x: Issue 62 Change bcm283x to use ioctl for GPIO pins, not sysfs.#63
maruel merged 9 commits intoperiph:mainfrom
gsexton:bcm283x

Conversation

@gsexton
Copy link
Contributor

@gsexton gsexton commented Oct 21, 2024

This fixes Edge detection does not work on Raspbian Bookworm #62

It changes the bcm283x/gpio.go to use gpioioctl rather than sysfs.

With this patch, obtaining GPIO pins via:

      outPin:=gpioreg.ByName("GPIO2")
      inPin:=gpioreg.ByName("GPIO10")

or
        outPin:=rpi.P1_3
        inPin:=rpi.P1_19

now work as expected.

@codecov-commenter
Copy link

codecov-commenter commented Oct 21, 2024

Codecov Report

❌ Patch coverage is 34.72222% with 94 lines in your changes missing coverage. Please review.
✅ Project coverage is 27.4%. Comparing base (7540d26) to head (5005af9).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
gpioioctl/gpio.go 18.6% 48 Missing ⚠️
bcm283x/gpio.go 34.4% 20 Missing and 1 partial ⚠️
gpioioctl/ioctl.go 0.0% 6 Missing ⚠️
gpioioctl/syscall.go 0.0% 6 Missing ⚠️
gpioioctl/syscall_other.go 0.0% 6 Missing ⚠️
gpioioctl/dummy.go 82.8% 4 Missing and 1 partial ⚠️
gpioioctl/lineset.go 0.0% 2 Missing ⚠️

❌ Your patch status has failed because the patch coverage (34.7%) is below the target coverage (60.0%). You can increase the patch coverage or adjust the target coverage.
❌ Your project status has failed because the head coverage (27.4%) is below the target coverage (60.0%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff           @@
##            main     #63     +/-   ##
=======================================
+ Coverage   26.8%   27.4%   +0.5%     
=======================================
  Files         92      96      +4     
  Lines      11548   11774    +226     
=======================================
+ Hits        3097    3221    +124     
- Misses      8316    8418    +102     
  Partials     135     135             

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gsexton
Copy link
Contributor Author

gsexton commented Oct 21, 2024

@maruel can you give me an idea of how to fix this?

periph.io/x/host/v3/bcm283x

Error: bcm283x/gpio.go:199:22: undefined: gpioioctl.GPIOLine
Error: bcm283x/gpio.go:1334:19: undefined: gpioioctl.Chips
Error: bcm283x/gpio.go:1378:21: undefined: gpioioctl.Chips

@gsexton
Copy link
Contributor Author

gsexton commented Oct 21, 2024

@maruel can you give me an idea of how to fix this?

periph.io/x/host/v3/bcm283x

Error: bcm283x/gpio.go:199:22: undefined: gpioioctl.GPIOLine Error: bcm283x/gpio.go:1334:19: undefined: gpioioctl.Chips Error: bcm283x/gpio.go:1378:21: undefined: gpioioctl.Chips

NM, I see the problem. gpioioctl doesn't exist for Windows/MacOS, and that's messing with it.

@maruel
Copy link
Member

maruel commented Oct 21, 2024

The stance periph.io takes is that the code is compilable on all platforms so users can read the documentation, e.g. in VSCode while on Windows but functionality that do not make sense (e.g. bcm238x on Windows) is okay to not work.

@maruel maruel merged commit 75941b8 into periph:main Oct 21, 2024
@maruel
Copy link
Member

maruel commented Oct 21, 2024

Thanks!

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants