From ac7c1acd9f8759d5f83cee979b8d6474e68e8a69 Mon Sep 17 00:00:00 2001 From: David Madison Date: Sat, 6 Mar 2021 09:36:11 -0500 Subject: [PATCH] XboxOld: Use VID and PID function check in init Avoiding duplicating the VID/PID check logic in multiple places --- XBOXOLD.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XBOXOLD.cpp b/XBOXOLD.cpp index a454d22a..87e7c644 100644 --- a/XBOXOLD.cpp +++ b/XBOXOLD.cpp @@ -118,7 +118,7 @@ uint8_t XBOXOLD::Init(uint8_t parent, uint8_t port, bool lowspeed) { VID = udd->idVendor; PID = udd->idProduct; - if((VID != XBOX_VID && VID != MADCATZ_VID && VID != JOYTECH_VID) || (PID != XBOX_OLD_PID1 && PID != XBOX_OLD_PID2 && PID != XBOX_OLD_PID3 && PID != XBOX_OLD_PID4)) // Check if VID and PID match + if(!VIDPIDOK(VID, PID)) // Check if VID and PID match goto FailUnknownDevice; // Allocate new address according to device class