Skip to content

Commit

Permalink
修复VID/PID匹配逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
yangpengya authored and sakumisu committed Dec 20, 2024
1 parent 75e6dc6 commit e6801fc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/usbh_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand Down

0 comments on commit e6801fc

Please sign in to comment.