core: fix single line event requests with flags
authorBartosz Golaszewski <bartekgola@gmail.com>
Thu, 13 Jul 2017 16:07:25 +0000 (18:07 +0200)
committerBartosz Golaszewski <bartekgola@gmail.com>
Thu, 13 Jul 2017 16:07:25 +0000 (18:07 +0200)
We currently always request rising edge events for the 'flags'
variants. Request correct event types.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
src/lib/core.c

index 4a2ef84f1c18123ce7042f205a0a77068b49dbb8..b3b16e59ae1291a6de1d435ace4642b273334d01 100644 (file)
@@ -636,14 +636,14 @@ int gpiod_line_request_falling_edge_events_flags(struct gpiod_line *line,
                                                 int flags)
 {
        return line_event_request_type(line, consumer, flags,
-                                      GPIOD_REQUEST_EVENT_RISING_EDGE);
+                                      GPIOD_REQUEST_EVENT_FALLING_EDGE);
 }
 
 int gpiod_line_request_both_edges_events_flags(struct gpiod_line *line,
                                               const char *consumer, int flags)
 {
        return line_event_request_type(line, consumer, flags,
-                                      GPIOD_REQUEST_EVENT_RISING_EDGE);
+                                      GPIOD_REQUEST_EVENT_BOTH_EDGES);
 }
 
 int gpiod_line_request_bulk(struct gpiod_line_bulk *bulk,