mirror of
https://github.com/RPCS3/libusb.git
synced 2026-07-21 00:16:04 -04:00
Documentation: fix hotplug example
* add a missing call to libusb_handle_events_completed() * add a missing argument to libusb_hotplug_deregister_callback()
This commit is contained in:
committed by
Ludovic Rousseau
parent
77212172a1
commit
93de199d8d
+6
-1
@@ -86,6 +86,10 @@
|
||||
*
|
||||
* The following code provides an example of the usage of the hotplug interface:
|
||||
\code
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <libusb.h>
|
||||
|
||||
static int count = 0;
|
||||
|
||||
int hotplug_callback(struct libusb_context *ctx, struct libusb_device *dev,
|
||||
@@ -131,10 +135,11 @@ int main (void) {
|
||||
}
|
||||
|
||||
while (count < 2) {
|
||||
libusb_handle_events_completed(NULL, NULL);
|
||||
usleep(10000);
|
||||
}
|
||||
|
||||
libusb_hotplug_deregister_callback(handle);
|
||||
libusb_hotplug_deregister_callback(NULL, handle);
|
||||
libusb_exit(NULL);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define LIBUSB_NANO 10867
|
||||
#define LIBUSB_NANO 10868
|
||||
|
||||
Reference in New Issue
Block a user