Searched hist:"9 f8df20c85ca77f0dd653021926b63c3b48bba79" (Results 1 – 1 of 1) sorted by relevance
/freebsd/sys/dev/gpio/ |
H A D | gpioths.c | diff 9f8df20c85ca77f0dd653021926b63c3b48bba79 Sun Dec 08 21:13:42 CET 2019 Ian Lepore <ian@FreeBSD.org> Several small fixes for the gpioths (temp/humidity sensor) driver.
At the end of a read cycle, set the gpio pin to INPUT rather than OUTPUT. The state of the single-wire "bus" when idle should be high; setting the pin to input allows the external pullup to pull the line high. Setting it to output (and leaving it driving low) was leading a good read cycle followed by one that would fail, and it just continued like that forever, effectively reading the sensor once every 10 seconds instead of 5.
In the attach function, do an initial read from the device before registering the sysctls for accessing the last-read values, to prevent reading spurious values for the first 5 seconds after the driver attaches.
Do a callout_drain() in the detach function to prevent crashes after unloading the module.
|