Compare commits

...

2 commits

2 changed files with 3 additions and 3 deletions

1
main.c
View file

@ -38,6 +38,7 @@ int main(int, char**)
struct miix_wlr_state* state = miix_wlr_init();
for (;;) {
thrd_sleep(&(struct timespec){0, 10000000UL}, NULL);
if (!monitor->data_is_ready) continue;
if (base_station_detector && base_station_detector->is_connected) {

View file

@ -46,6 +46,8 @@ struct usb_detector* create_detector(uint16_t vendor_id, uint16_t product_id)
struct usb_detector* detector = calloc(1, sizeof(struct usb_detector));
detector->usb_context = usb_context;
detector->is_connected = false;
detector->event_handler_should_exit = false;
if (libusb_hotplug_register_callback(detector->usb_context,
LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED |
@ -66,9 +68,6 @@ struct usb_detector* create_detector(uint16_t vendor_id, uint16_t product_id)
return 0;
}
detector->is_connected = false;
detector->event_handler_should_exit = false;
if (thrd_create(&detector->event_handler_thread,
&libusb_event_handler,
detector) != thrd_success) {