Describe the bug
I'm not necessarily sure if this is a bug, but gpioioctl uses WaitForEdge(0) to mean "wait forever", while the rest of the packages use -1. WaitForEdge() works correctly according to its own source-level documentation, but its at odds with the rest of the packages which use -1 to mean "wait forever." Using WaitForEdge(-1) with gpioioctl will cause it to immediately return false.
https://github.com/periph/host/blame/main/gpioioctl/gpio.go#L239
I think this line could just be changed to if timeout < 1, but I didn't want to presume it was a bug if this was completely intentional.
Additional context
The 0 value seems confusing based on prior issues like periph/conn#40 which say that gpioioctl is the solution to the most-likely sysfs-related issues in the past, but the submitted code in that issue would still "be broken" with the gpioioctl implementation.
Describe the bug
I'm not necessarily sure if this is a bug, but gpioioctl uses
WaitForEdge(0)to mean "wait forever", while the rest of the packages use-1.WaitForEdge()works correctly according to its own source-level documentation, but its at odds with the rest of the packages which use-1to mean "wait forever." UsingWaitForEdge(-1)with gpioioctl will cause it to immediately return false.https://github.com/periph/host/blame/main/gpioioctl/gpio.go#L239
I think this line could just be changed to
if timeout < 1, but I didn't want to presume it was a bug if this was completely intentional.Additional context
The
0value seems confusing based on prior issues like periph/conn#40 which say that gpioioctl is the solution to the most-likely sysfs-related issues in the past, but the submitted code in that issue would still "be broken" with the gpioioctl implementation.