Re: [libgpiod] reading multiple lines after edge event

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 15, 2020 at 10:45 PM Gerrit Wyen <ml@xxxxxxxxxxxx> wrote:
>
> Hi,
>
> can someone explain the following behavior and whether it is a bug?
>
> When reading two lines at once via get_values() in response to an edge
> event I only receive the correct value for the first line (second line
> is high during the test but always reported as low).
> See example code below:
>
> lines.request({
>   “gpiotest”, ::gpiod::line_request::EVENT_BOTH_EDGES,
>   0,
> });
>
> auto events = lines.event_wait(::std::chrono::seconds(10));
> if (events) {
>   auto values = lines.get_values();
>   for (auto& it: values) {
>     ::std::cout << it;
>     }
>   }
>
> However reading the same lines via get_value() one by one after the
> event works correctly. Like so:
>
> for (auto& it: lines) { ::std::cout << it.get_value(); }
>
>
> Also, when reading them without waiting for the event with
> line_request::DIRECTION_INPUT  the correct values are returned by
> get_values() as well as by get_value().
>
> This behavior was tested on multiple different devices.

One side question: do you have kernel 64-bit and user space 64-bit, or?
Also, can you provide versions of the kernel and libgpiod, if you are
using latter?

-- 
With Best Regards,
Andy Shevchenko




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux