2018.07.26
Dependencies: FATFileSystem3 mbed-rtos
Fork of USBHost by
Diff: USBHostHID/USBHostGamepad.cpp
- Revision:
- 34:cac1e8336448
- Parent:
- 33:86c22c0c8aae
- Child:
- 39:8fbe33e98b2b
--- a/USBHostHID/USBHostGamepad.cpp Thu Jun 18 08:05:23 2015 +0000 +++ b/USBHostHID/USBHostGamepad.cpp Wed Jun 24 06:57:55 2015 +0000 @@ -86,7 +86,11 @@ if (!int_in) break; - USB_INFO("New Gamepad/Joystick device: VID:%04x PID:%04x [dev: %p - intf: %d]", dev->getVid(), dev->getPid(), dev, gamepad_intf); + gamePad_VID = dev->getVid(); + gamePad_PID = dev->getPid(); + + // USB_INFO("New Gamepad/Joystick device: VID:%04x PID:%04x [dev: %p - intf: %d]", dev->getVid(), dev->getPid(), dev, gamepad_intf); + USB_INFO("New Gamepad/Joystick device: VID:%04x PID:%04x [dev: %p - intf: %d]", gamePad_VID, gamePad_PID, dev, gamepad_intf); #if DEBUG > 3 //Parse HID Report Descriptor parseHidDescr(); @@ -115,8 +119,9 @@ // printf("GamePad Length=%dyryn", len_listen); #if DEBUG > 3 USB_DBG("USBHostGamepad::rxHandler() len_listen=%d\r\n", len_listen); - for (int i = 0; i < len_listen; i++) + for (int i = 0; i < len_listen; i++){ printf("%02X ", report[i]); + } printf("\r\n\r\n"); #endif if (onUpdate) { @@ -137,7 +142,10 @@ report[12], report[13], report[14], - report[15] + report[15], + dev->getVid(), + dev->getPid() + ); } @@ -162,6 +170,9 @@ btn13 = report[13]; btn14 = report[14]; btn15 = report[15]; + + // gamePad_VID = dev->getVid(); + // gamePad_PID = dev->getPid(); if (len_listen > sizeof(report)) { len_listen = sizeof(report);