mirror of
https://github.com/shakemid/pcsensor-temper.git
synced 2025-01-21 00:58:17 +01:00
Merge pull request #5 from c72578/2019-12-06_Fix_libusb_set_debug_deprecated_warnings
Fix libusb_set_debug deprecated warnings
This commit is contained in:
commit
990a64b7fc
1 changed files with 7 additions and 3 deletions
10
pcsensor.c
10
pcsensor.c
|
@ -192,15 +192,19 @@ int find_lvr_winusb(temper_device_t *devices) {
|
||||||
|
|
||||||
int setup_libusb_access(temper_device_t *devices) {
|
int setup_libusb_access(temper_device_t *devices) {
|
||||||
int i;
|
int i;
|
||||||
|
int log_level = 0; // LIBUSB_LOG_LEVEL_NONE
|
||||||
int numdev;
|
int numdev;
|
||||||
|
|
||||||
libusb_init(&ctx);
|
libusb_init(&ctx);
|
||||||
|
|
||||||
if(debug) {
|
if(debug) {
|
||||||
libusb_set_debug(ctx, 4); //LIBUSB_LOG_LEVEL_DEBUG
|
log_level = 4; // LIBUSB_LOG_LEVEL_DEBUG
|
||||||
} else {
|
|
||||||
libusb_set_debug(ctx, 0); //LIBUSB_LOG_LEVEL_NONE
|
|
||||||
}
|
}
|
||||||
|
#if LIBUSBX_API_VERSION < 0x01000106
|
||||||
|
libusb_set_debug(ctx, log_level);
|
||||||
|
#else
|
||||||
|
libusb_set_option(ctx, LIBUSB_OPTION_LOG_LEVEL, log_level);
|
||||||
|
#endif
|
||||||
|
|
||||||
if((numdev = find_lvr_winusb(devices)) < 1) {
|
if((numdev = find_lvr_winusb(devices)) < 1) {
|
||||||
fprintf(stderr, "Couldn't find the USB device, Exiting: %d\n", numdev);
|
fprintf(stderr, "Couldn't find the USB device, Exiting: %d\n", numdev);
|
||||||
|
|
Loading…
Add table
Reference in a new issue