Browse Source

Add Saitek X52 Pro VID/PID

Thomas Buck 8 years ago
parent
commit
52ecdee2aa
1 changed files with 10 additions and 1 deletions
  1. 10
    1
      x52.cpp

+ 10
- 1
x52.cpp View File

25
         return;
25
         return;
26
     }
26
     }
27
 
27
 
28
+    // Get the USB device descriptor so we can check for a valid PID/VID
28
     uint8_t buf[sizeof (USB_DEVICE_DESCRIPTOR)];
29
     uint8_t buf[sizeof (USB_DEVICE_DESCRIPTOR)];
29
     USB_DEVICE_DESCRIPTOR* udd = reinterpret_cast<USB_DEVICE_DESCRIPTOR*>(buf);
30
     USB_DEVICE_DESCRIPTOR* udd = reinterpret_cast<USB_DEVICE_DESCRIPTOR*>(buf);
30
     uint8_t ret = usb->getDevDescr(hid->GetAddress(), 0, sizeof(USB_DEVICE_DESCRIPTOR), (uint8_t*)buf);
31
     uint8_t ret = usb->getDevDescr(hid->GetAddress(), 0, sizeof(USB_DEVICE_DESCRIPTOR), (uint8_t*)buf);
45
         Serial.println(pid, DEC);
46
         Serial.println(pid, DEC);
46
 #endif
47
 #endif
47
 
48
 
48
-    if ((vid == 1699) && (pid == 597)) {
49
+    if ((vid == 0x06A3) && (pid == 0x0255)) {
50
+        // Saitek X52
51
+        ready = 1;
52
+    } else if ((vid == 0x06A3) && (pid == 0x0762)) {
53
+        // Saitek X52 Pro
49
         ready = 1;
54
         ready = 1;
50
     } else {
55
     } else {
51
 #ifdef DEBUG_OUTPUT
56
 #ifdef DEBUG_OUTPUT
138
     };
143
     };
139
 
144
 
140
     if (line >= 3) {
145
     if (line >= 3) {
146
+#ifdef DEBUG_OUTPUT
147
+        Serial.print("Invalid line: ");
148
+        Serial.println(line, DEC);
149
+#endif
141
         return;
150
         return;
142
     }
151
     }
143
 
152
 

Loading…
Cancel
Save