Commit Graph

5 Commits (report-buttons-in-order)

Author SHA1 Message Date
nirenjan 03c0376e7c Initialize variables to avoid maybe-uninitialized warnings
When building the package for PPA, gcc throws errors indicating that
some variables may be used uninitialized. This is not a real problem
that shows up during the CI build, but only when building using
dpkg-buildpackage.

This change adds some dummy initialization so that it avoids triggering
those warnings during debuild/dpkg-buildpackage.
2023-01-03 12:26:51 -08:00
nirenjan 3a81acf828 Fix build with newer version of libusb 2021-09-14 09:28:00 -07:00
nirenjan 627c1fb004 Use libusb hotplug API to automatically detect disconnection
Prior to this commit, the libx52_is_connected API was simply checking if
the device handle was non-NULL. However, this was insufficient, since
the device disconnection would not reset the handle, and was relying on
the daemon to manually disconnect.

The libusb hotplug API provides functionality to register a callback on
device insertion/removal. libx52 only registers for removal, and will
automatically disconnect the device on receiving the callback. This also
modifies libx52_is_connected to fallback to checking if the kernel
driver is active if the linked libusb does not support hotplug (unlikely).

Finally, this commit adds support for the new hotplug related functions
to the libusbx52 preload library. While the preload library doesn't
actually support hotplug, it is sufficient to pretend that it does.
2021-09-14 09:03:23 -07:00
nirenjan ac68ee07e5 Use non-recursive Automake 2021-07-29 23:53:21 -07:00
nirenjan 3b2378a54b Move libusbx52 to top level 2021-07-29 21:57:19 -07:00