2018.07.26
Dependencies: FATFileSystem3 mbed-rtos
Fork of USBHost by
Diff: USBHostHID/USBHostGamepad.h
- Revision:
- 33:86c22c0c8aae
- Parent:
- 32:e6717a485577
- Child:
- 34:cac1e8336448
--- a/USBHostHID/USBHostGamepad.h Tue Jun 02 05:57:44 2015 +0000 +++ b/USBHostHID/USBHostGamepad.h Thu Jun 18 08:05:23 2015 +0000 @@ -67,7 +67,8 @@ * * @param ptr function pointer */ - inline void attachEvent(void (*ptr)(uint8_t btnX, uint8_t btnY, uint8_t btnABCD, uint8_t btnSpecial)) { +// inline void attachEvent(void (*ptr)(uint8_t btnX, uint8_t btnY, uint8_t btnABCD, uint8_t btnSpecial)) { + inline void attachEvent(void (*ptr)(uint8_t btn00, uint8_t btn01, uint8_t btn02, uint8_t btn03, uint8_t btn04, uint8_t btn05, uint8_t btn06, uint8_t btn07, uint8_t btn08, uint8_t btn09, uint8_t btn10, uint8_t btn11, uint8_t btn12, uint8_t btn13, uint8_t btn14, uint8_t btn15)) { if (ptr != NULL) { onUpdate = ptr; } @@ -93,7 +94,8 @@ USBHost * host; USBDeviceConnected * dev; USBEndpoint * int_in; - uint8_t report[8]; +// uint8_t report[8]; + uint8_t report[16]; bool dev_connected; bool gamepad_device_found; @@ -104,8 +106,28 @@ uint8_t btnABCD; uint8_t btnSpecial; + uint8_t btn00; + uint8_t btn01; + uint8_t btn02; + uint8_t btn03; + uint8_t btn04; + uint8_t btn05; + uint8_t btn06; + uint8_t btn07; + uint8_t btn08; + uint8_t btn09; + uint8_t btn10; + uint8_t btn11; + uint8_t btn12; + uint8_t btn13; + uint8_t btn14; + uint8_t btn15; + + void rxHandler(); - void (*onUpdate)(uint8_t btnX, uint8_t btnY, uint8_t btnABCD, uint8_t btnSpecial); +// void (*onUpdate)(uint8_t btnX, uint8_t btnY, uint8_t btnABCD, uint8_t btnSpecial); + void (*onUpdate)(uint8_t btn00, uint8_t btn01, uint8_t btn02, uint8_t btn03, uint8_t btn04, uint8_t btn05, uint8_t btn06, uint8_t btn07, uint8_t btn08, uint8_t btn09, uint8_t btn10, uint8_t btn11, uint8_t btn12, uint8_t btn13,uint8_t btn14,uint8_t btn15 ); + int report_id; void init(); bool parseHidDescr();