diff options
| author | yangpeng <[email protected]> | 2024-12-20 16:11:00 +0800 |
|---|---|---|
| committer | sakumisu <[email protected]> | 2024-12-20 16:37:59 +0800 |
| commit | e6801fcbb82f0c5956b3a3f324de12f12ad51b96 (patch) | |
| tree | 6ef2c23feea2d5e224ffe07b4eab824ca9396037 | |
| parent | 75e6dc6300805331e885f5dc45edf8c2154f2799 (diff) | |
修复VID/PID匹配逻辑
| -rw-r--r-- | core/usbh_core.c | 5 |
1 files changed, 4 insertions, 1 deletions
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]) { |
