On 03/06/2018 10:17 AM, Bartosz Gołaszewski wrote:
You need to call gpiod_line_request_both_edges_events() only once - instead you call it within a while loop for already taken lines.
Ok, now my test works, kinda. I don't get any errors.
In your strace output gpiod_line_request_both_edges_events() returned 0 (the internal ioctl() returned 0) and then you even start polling for event and the call to ppoll() returns an event on file descriptor #5. Next iteration you bail out from gpiod_line_request_bulk() (called indirectly by gpiod_line_request_both_edges_events()) where we check if the line is busy.
However, gpiod_line_event_wait() always returns immediately with value 1. It doesn't actually wait for the GPIO to change value from 0 to 1 or 1 to 0.
When I call gpiod_line_event_read() after gpiod_line_event_wait() returns, I get this:
ts=1.004199700 type=37 -- Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html