From 5078f35c9b87fd7d6809cf38893178ceaabb6135 Mon Sep 17 00:00:00 2001 From: MCUdude Date: Wed, 14 Jun 2023 20:20:12 +0200 Subject: [PATCH 1/2] Mute missing USB device warning for lower verbosity levels --- src/usb_hidapi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/usb_hidapi.c b/src/usb_hidapi.c index 7dd78314..0ad18409 100644 --- a/src/usb_hidapi.c +++ b/src/usb_hidapi.c @@ -123,8 +123,10 @@ static int usbhid_open(const char *port, union pinfo pinfo, union filedescriptor dev = hid_open(pinfo.usbinfo.vid, pinfo.usbinfo.pid, NULL); if (dev == NULL) { + if (verbose > 1) { pmsg_warning("USB device with VID: 0x%04x and PID: 0x%04x not found\n", pinfo.usbinfo.vid, pinfo.usbinfo.pid); + } return -1; } } From 10cc234e15138ef0eeac328567aedee96582c2f6 Mon Sep 17 00:00:00 2001 From: MCUdude Date: Thu, 15 Jun 2023 19:44:32 +0200 Subject: [PATCH 2/2] Use pmsg_notice2 instead of pmsg_warning --- src/usb_hidapi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/usb_hidapi.c b/src/usb_hidapi.c index 0ad18409..34d76822 100644 --- a/src/usb_hidapi.c +++ b/src/usb_hidapi.c @@ -123,10 +123,8 @@ static int usbhid_open(const char *port, union pinfo pinfo, union filedescriptor dev = hid_open(pinfo.usbinfo.vid, pinfo.usbinfo.pid, NULL); if (dev == NULL) { - if (verbose > 1) { - pmsg_warning("USB device with VID: 0x%04x and PID: 0x%04x not found\n", + pmsg_notice2("USB device with VID: 0x%04x and PID: 0x%04x not found\n", pinfo.usbinfo.vid, pinfo.usbinfo.pid); - } return -1; } }