From e6801fcbb82f0c5956b3a3f324de12f12ad51b96 Mon Sep 17 00:00:00 2001 From: yangpeng Date: Fri, 20 Dec 2024 16:11:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DVID/PID=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/usbh_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/usbh_core.c b/core/usbh_core.c index 444eaa7e..cb36f97e 100644 --- a/core/usbh_core.c +++ b/core/usbh_core.c @@ -105,7 +105,10 @@ static const struct usbh_class_driver *usbh_find_class_driver(uint8_t class, uin if (index->match_flags & USB_CLASS_MATCH_VID_PID && index->id_table) { /* scan id table */ uint32_t i; - for (i = 0; index->id_table[i][0] && index->id_table[i][0] != vid && index->id_table[i][1] != pid; i++) { + for (i = 0; index->id_table[i][0]; i++) { + if (index->id_table[i][0] == vid && index->id_table[i][1] == pid) { + break; + } } /* do not match, continue next */ if (!index->id_table[i][0]) {