Skip to content

Commit ac5d134

Browse files
committed
Added support for Afterglow wired Xbox controller
1 parent 9b44357 commit ac5d134

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

XBOXUSB.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ uint8_t XBOXUSB::Init(uint8_t parent, uint8_t port, bool lowspeed) {
105105
Notify(PSTR("\r\nThis library only supports Xbox 360 controllers via USB"), 0x80);
106106
#endif
107107
goto FailUnknownDevice;
108-
} else if(PID != XBOX_WIRED_PID && PID != MADCATZ_WIRED_PID && PID != GAMESTOP_WIRED_PID) // Check PID
108+
} else if(PID != XBOX_WIRED_PID && PID != MADCATZ_WIRED_PID && PID != GAMESTOP_WIRED_PID && PID != AFTERGLOW_WIRED_PID) // Check PID
109109
goto FailUnknownDevice;
110110

111111
// Allocate new address according to device class

XBOXUSB.h

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,18 @@
3333
#define XBOX_OUTPUT_PIPE 2
3434

3535
// PID and VID of the different devices
36-
#define XBOX_VID 0x045E // Microsoft Corporation
37-
#define MADCATZ_VID 0x1BAD // For unofficial Mad Catz controllers
38-
#define JOYTECH_VID 0x162E // For unofficial Joytech controllers
39-
#define GAMESTOP_VID 0x0E6F // Gamestop controller
40-
41-
#define XBOX_WIRED_PID 0x028E // Microsoft 360 Wired controller
42-
#define XBOX_WIRELESS_PID 0x028F // Wireless controller only support charging
43-
#define XBOX_WIRELESS_RECEIVER_PID 0x0719 // Microsoft Wireless Gaming Receiver
44-
#define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID 0x0291 // Third party Wireless Gaming Receiver
45-
#define MADCATZ_WIRED_PID 0xF016 // Mad Catz wired controller
46-
#define GAMESTOP_WIRED_PID 0x0401 // Gamestop wired controller
36+
#define XBOX_VID 0x045E // Microsoft Corporation
37+
#define MADCATZ_VID 0x1BAD // For unofficial Mad Catz controllers
38+
#define JOYTECH_VID 0x162E // For unofficial Joytech controllers
39+
#define GAMESTOP_VID 0x0E6F // Gamestop controller
40+
41+
#define XBOX_WIRED_PID 0x028E // Microsoft 360 Wired controller
42+
#define XBOX_WIRELESS_PID 0x028F // Wireless controller only support charging
43+
#define XBOX_WIRELESS_RECEIVER_PID 0x0719 // Microsoft Wireless Gaming Receiver
44+
#define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID 0x0291 // Third party Wireless Gaming Receiver
45+
#define MADCATZ_WIRED_PID 0xF016 // Mad Catz wired controller
46+
#define GAMESTOP_WIRED_PID 0x0401 // Gamestop wired controller
47+
#define AFTERGLOW_WIRED_PID 0x0213 // Afterglow wired controller - it uses the same VID as a Gamestop controller
4748

4849
#define XBOX_REPORT_BUFFER_SIZE 14 // Size of the input report buffer
4950

@@ -105,7 +106,7 @@ class XBOXUSB : public USBDeviceConfig {
105106
* @return Returns true if the device's VID and PID matches this driver.
106107
*/
107108
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
108-
return ((vid == XBOX_VID || vid == MADCATZ_VID || vid == JOYTECH_VID || vid == GAMESTOP_VID) && (pid == XBOX_WIRED_PID || pid == MADCATZ_WIRED_PID || pid == GAMESTOP_WIRED_PID));
109+
return ((vid == XBOX_VID || vid == MADCATZ_VID || vid == JOYTECH_VID || vid == GAMESTOP_VID) && (pid == XBOX_WIRED_PID || pid == MADCATZ_WIRED_PID || pid == GAMESTOP_WIRED_PID || pid == AFTERGLOW_WIRED_PID));
109110
};
110111
/**@}*/
111112

0 commit comments

Comments
 (0)