|
@@ -42,6 +42,37 @@ static const uint8_t PUCK_HID_DESC[] = {
|
|
|
0x01,0xB1,0x02,0xC0
|
|
0x01,0xB1,0x02,0xC0
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// Pure MODE_LIZARD only: same puck/lizard descriptor plus a tiny Consumer Control report for media keys.
|
|
|
|
|
+// MODE_STEAM must keep PUCK_HID_DESC verbatim so Steam's controller/haptics path sees the normal puck shape.
|
|
|
|
|
+static const uint8_t PUCK_LIZARD_HID_DESC[] = {
|
|
|
|
|
+ 0x05,0x01,0x09,0x02,0xA1,0x01,0x85,0x40,0x09,0x01,0xA1,0x00,0x05,0x09,0x19,0x01,
|
|
|
|
|
+ 0x29,0x02,0x15,0x00,0x25,0x01,0x75,0x01,0x95,0x02,0x81,0x02,0x75,0x06,0x95,0x01,
|
|
|
|
|
+ 0x81,0x01,0x05,0x01,0x09,0x30,0x09,0x31,0x15,0x81,0x25,0x7F,0x75,0x08,0x95,0x02,
|
|
|
|
|
+ 0x81,0x06,0x95,0x01,0x09,0x38,0x81,0x06,0x05,0x0C,0x0A,0x38,0x02,0x95,0x01,0x81,
|
|
|
|
|
+ 0x06,0xC0,0xC0,0x05,0x01,0x09,0x06,0xA1,0x01,0x85,0x41,0x05,0x07,0x19,0xE0,0x29,
|
|
|
|
|
+ 0xE7,0x15,0x00,0x25,0x01,0x75,0x01,0x95,0x08,0x81,0x02,0x81,0x01,0x19,0x00,0x29,
|
|
|
|
|
+ 0x65,0x15,0x00,0x25,0x65,0x75,0x08,0x95,0x06,0x81,0x00,0xC0,0x06,0x00,0xFF,0x09,
|
|
|
|
|
+ 0x01,0xA1,0x01,0x85,0x42,0x15,0x00,0x26,0xFF,0x00,0x75,0x08,0x95,0x35,0x09,0x42,
|
|
|
|
|
+ 0x81,0x02,0x85,0x44,0x15,0x00,0x26,0xFF,0x00,0x75,0x08,0x95,0x05,0x09,0x44,0x81,
|
|
|
|
|
+ 0x02,0x85,0x79,0x15,0x00,0x26,0xFF,0x00,0x75,0x08,0x95,0x01,0x09,0x79,0x81,0x02,
|
|
|
|
|
+ 0x85,0x43,0x15,0x00,0x26,0xFF,0x00,0x75,0x08,0x95,0x0E,0x09,0x43,0x81,0x02,0x85,
|
|
|
|
|
+ 0x7B,0x15,0x00,0x26,0xFF,0x00,0x75,0x08,0x95,0x0C,0x09,0x7B,0x81,0x02,0x85,0x45,
|
|
|
|
|
+ 0x15,0x00,0x26,0xFF,0x00,0x75,0x08,0x95,0x2D,0x09,0x45,0x81,0x02,0x85,0x80,0x15,
|
|
|
|
|
+ 0x00,0x26,0xFF,0x00,0x75,0x08,0x95,0x09,0x09,0x80,0x91,0x02,0x85,0x81,0x15,0x00,
|
|
|
|
|
+ 0x26,0xFF,0x00,0x75,0x08,0x95,0x07,0x09,0x81,0x91,0x02,0x85,0x82,0x15,0x00,0x26,
|
|
|
|
|
+ 0xFF,0x00,0x75,0x08,0x95,0x03,0x09,0x82,0x91,0x02,0x85,0x83,0x15,0x00,0x26,0xFF,
|
|
|
|
|
+ 0x00,0x75,0x08,0x95,0x09,0x09,0x83,0x91,0x02,0x85,0x84,0x15,0x00,0x26,0xFF,0x00,
|
|
|
|
|
+ 0x75,0x08,0x95,0x08,0x09,0x84,0x91,0x02,0x85,0x85,0x15,0x00,0x26,0xFF,0x00,0x75,
|
|
|
|
|
+ 0x08,0x95,0x03,0x09,0x85,0x91,0x02,0x85,0x86,0x15,0x00,0x26,0xFF,0x00,0x75,0x08,
|
|
|
|
|
+ 0x95,0x03,0x09,0x86,0x91,0x02,0x85,0x87,0x15,0x00,0x26,0xFF,0x00,0x75,0x08,0x95,
|
|
|
|
|
+ 0x3F,0x09,0x87,0x91,0x02,0x85,0x89,0x15,0x00,0x26,0xFF,0x00,0x75,0x08,0x95,0x3F,
|
|
|
|
|
+ 0x09,0x89,0x91,0x02,0x85,0x88,0x15,0x00,0x26,0xFF,0x00,0x75,0x08,0x95,0x3F,0x09,
|
|
|
|
|
+ 0x88,0x91,0x02,0x85,0x01,0x95,0x3F,0x09,0x01,0xB1,0x02,0x85,0x02,0x95,0x3F,0x09,
|
|
|
|
|
+ 0x01,0xB1,0x02,0xC0,
|
|
|
|
|
+ 0x05,0x0C,0x09,0x01,0xA1,0x01,0x85,0x03,0x15,0x00,0x25,0x01,0x09,0xE9,0x09,0xEA,
|
|
|
|
|
+ 0x75,0x01,0x95,0x02,0x81,0x02,0x75,0x06,0x95,0x01,0x81,0x01,0xC0
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
static Adafruit_USBD_HID hid[NSLOT];
|
|
static Adafruit_USBD_HID hid[NSLOT];
|
|
|
|
|
|
|
|
// ===================== seamless LIZARD decision =====================
|
|
// ===================== seamless LIZARD decision =====================
|
|
@@ -190,11 +221,13 @@ void SteamPuckController::begin(){
|
|
|
// tied to the real Steam Controller (28DE:1304), which has no WebUSB interface. The normal (wake-mouse) and
|
|
// tied to the real Steam Controller (28DE:1304), which has no WebUSB interface. The normal (wake-mouse) and
|
|
|
// one-shot debug (CDC) boots present DIFFERENT interface sets, so they use DIFFERENT bcdDevice values --
|
|
// one-shot debug (CDC) boots present DIFFERENT interface sets, so they use DIFFERENT bcdDevice values --
|
|
|
// otherwise Windows would serve one's cached descriptor for the other when you reboot between them.
|
|
// otherwise Windows would serve one's cached descriptor for the other when you reboot between them.
|
|
|
- USBDevice.setDeviceVersion(g_debugCdcThisBoot ? 0x0212 : 0x0211);
|
|
|
|
|
|
|
+ USBDevice.setDeviceVersion(g_debugCdcThisBoot ? 0x0212 : (g_usbMode == MODE_LIZARD ? 0x0213 : 0x0211));
|
|
|
USBDevice.setManufacturerDescriptor("Valve Software");
|
|
USBDevice.setManufacturerDescriptor("Valve Software");
|
|
|
USBDevice.setProductDescriptor("Steam Controller Puck");
|
|
USBDevice.setProductDescriptor("Steam Controller Puck");
|
|
|
|
|
+ const uint8_t* desc = (g_usbMode == MODE_LIZARD) ? PUCK_LIZARD_HID_DESC : PUCK_HID_DESC;
|
|
|
|
|
+ const uint16_t descLen = (g_usbMode == MODE_LIZARD) ? sizeof PUCK_LIZARD_HID_DESC : sizeof PUCK_HID_DESC;
|
|
|
for (int i = 0; i < NSLOT; i++) {
|
|
for (int i = 0; i < NSLOT; i++) {
|
|
|
- hid[i].setReportDescriptor(PUCK_HID_DESC, sizeof PUCK_HID_DESC);
|
|
|
|
|
|
|
+ hid[i].setReportDescriptor(desc, descLen);
|
|
|
hid[i].setReportCallback(GETCB[i], SETCB[i]);
|
|
hid[i].setReportCallback(GETCB[i], SETCB[i]);
|
|
|
hid[i].setPollInterval(1); // 1ms USB poll (was default 10ms = 100/s cap -> choppy)
|
|
hid[i].setPollInterval(1); // 1ms USB poll (was default 10ms = 100/s cap -> choppy)
|
|
|
hid[i].begin();
|
|
hid[i].begin();
|