hankso / gpio4

Improved gpio module based on Sysfs and gpio3, drop-in replacement of RPi.GPIO
MIT License
9 stars 5 forks source link

Feature/fix interrupts #2

Open LinusCDE opened 4 years ago

LinusCDE commented 4 years ago

Hi hanko,

I came across this library on pypi.org when searching for an alternative gpio lib for using on a BBB (BeagleBone Black) with BuildRoot. After I added a custom pinmapping I stumpled upon the the interrupts not working. This library is awesome otherwise! I didn't find any other gpio sysfs library that had even support for add_event_detect() and the likes. Most just mimic the most basic functions of the RPi.GPIO Library.

Anyway, in this PR, I fixed the interrupts. I hope it's a worthwhile addition.


On another note: In this commit I had to change the edge for both from "change" to "both" (as explained in the commits description). I have not added this here, since I don't know whether that was just a certainty for the specific kernel I'm using. Do you happen to know more specifics on that one?


EDIT: Please also consider adding a release for v0.0.8. I pulled the v0.0.5 version and was stumped for a bit when setup() didn't work at all.