From 3dea5b880f614660c4f741c91f013a661db2a6bf Mon Sep 17 00:00:00 2001 From: Oleg Mazurov Date: Mon, 8 Jul 2013 12:46:32 -0600 Subject: [PATCH 01/13] fixed low speed direct attach --- Usb.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Usb.cpp b/Usb.cpp index 30d13f13..2d7e539a 100644 --- a/Usb.cpp +++ b/Usb.cpp @@ -452,9 +452,9 @@ void USB::Task(void) //USB state machine lowspeed = false; break; case LSHOST: - // if ((usb_task_state & USB_STATE_MASK) == USB_STATE_DETACHED) { - lowspeed = true; - // } + + lowspeed = true; + //intentional fallthrough case FSHOST: //attached if ((usb_task_state & USB_STATE_MASK) == USB_STATE_DETACHED) { delay = millis() + USB_SETTLE_DELAY; From 6a090c079185411e596152d36aecf54128b6b89e Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Fri, 2 Aug 2013 14:24:06 +0200 Subject: [PATCH 02/13] Ignore hrNAK error --- BTD.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BTD.cpp b/BTD.cpp index 703da2b2..9cb0134d 100755 --- a/BTD.cpp +++ b/BTD.cpp @@ -342,7 +342,7 @@ void BTD::HCI_event_task() { /* check the event pipe*/ uint16_t MAX_BUFFER_SIZE = BULK_MAXPKTSIZE; // Request more than 16 bytes anyway, the inTransfer routine will take care of this uint8_t rcode = pUsb->inTransfer(bAddress, epInfo[ BTD_EVENT_PIPE ].epAddr, &MAX_BUFFER_SIZE, hcibuf); // input on endpoint 1 - if (!rcode) // Check for errors + if (!rcode || rcode == hrNAK) // Check for errors { switch (hcibuf[0]) //switch on event type { @@ -527,7 +527,7 @@ void BTD::HCI_event_task() { } // switch } #ifdef EXTRADEBUG - else if (rcode != hrNAK) { + else { Notify(PSTR("\r\nHCI event error: "), 0x80); D_PrintHex (rcode, 0x80); } From 221fa78078a1b8ca53a25c11929bf4f2fc7d3d26 Mon Sep 17 00:00:00 2001 From: Oleg Mazurov Date: Fri, 9 Aug 2013 15:45:27 -0600 Subject: [PATCH 03/13] power control and stuff --- examples/testusbhostFAT/Arduino_Makefile_master | 2 +- examples/testusbhostFAT/generic_storage | 2 +- examples/testusbhostFAT/xmem2 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/testusbhostFAT/Arduino_Makefile_master b/examples/testusbhostFAT/Arduino_Makefile_master index 76e5edb2..f379bae0 160000 --- a/examples/testusbhostFAT/Arduino_Makefile_master +++ b/examples/testusbhostFAT/Arduino_Makefile_master @@ -1 +1 @@ -Subproject commit 76e5edb248b9078916cf46bdd4fd1a9e8201ca64 +Subproject commit f379bae02aa3d9c3da558ba2041558b88db95bbb diff --git a/examples/testusbhostFAT/generic_storage b/examples/testusbhostFAT/generic_storage index e717f2df..071b65b9 160000 --- a/examples/testusbhostFAT/generic_storage +++ b/examples/testusbhostFAT/generic_storage @@ -1 +1 @@ -Subproject commit e717f2df099491439877cc0d44a660688685dd54 +Subproject commit 071b65b923b2656bb1e1b622de5272b4ed9a4996 diff --git a/examples/testusbhostFAT/xmem2 b/examples/testusbhostFAT/xmem2 index e5f9968b..8bcf5f90 160000 --- a/examples/testusbhostFAT/xmem2 +++ b/examples/testusbhostFAT/xmem2 @@ -1 +1 @@ -Subproject commit e5f9968b42fb4970ec037290e5942e83accd4fad +Subproject commit 8bcf5f90f8bd967378b6eeebd7fd943f125fbc18 From c5684b8dfa9117a1e0507f21359c88d3bebf17ea Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Tue, 13 Aug 2013 12:54:03 +0200 Subject: [PATCH 04/13] fixes #61 --- examples/Xbox/XBOXRECV/XBOXRECV.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Xbox/XBOXRECV/XBOXRECV.ino b/examples/Xbox/XBOXRECV/XBOXRECV.ino index b508e837..8490800f 100644 --- a/examples/Xbox/XBOXRECV/XBOXRECV.ino +++ b/examples/Xbox/XBOXRECV/XBOXRECV.ino @@ -27,7 +27,7 @@ void loop() { Serial.print(Xbox.getButtonPress(L2,i)); Serial.print("\tR2: "); Serial.println(Xbox.getButtonPress(R2,i)); - Xbox.setRumbleOn(Xbox.getButtonPress(L2,i),Xbox.getButtonPress(R2,i)); + Xbox.setRumbleOn(Xbox.getButtonPress(L2,i),Xbox.getButtonPress(R2,i),i); } if(Xbox.getAnalogHat(LeftHatX,i) > 7500 || Xbox.getAnalogHat(LeftHatX,i) < -7500 || Xbox.getAnalogHat(LeftHatY,i) > 7500 || Xbox.getAnalogHat(LeftHatY,i) < -7500 || Xbox.getAnalogHat(RightHatX,i) > 7500 || Xbox.getAnalogHat(RightHatX,i) < -7500 || Xbox.getAnalogHat(RightHatY,i) > 7500 || Xbox.getAnalogHat(RightHatY,i) < -7500) { if(Xbox.getAnalogHat(LeftHatX,i) > 7500 || Xbox.getAnalogHat(LeftHatX,i) < -7500) { From 1f8322d54f64bd4f823c5dc5ae32ec26c52553f9 Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Tue, 13 Aug 2013 21:31:52 +0200 Subject: [PATCH 05/13] Some dongles have a hub inside --- examples/Bluetooth/PS3BT/PS3BT.ino | 3 +++ examples/Bluetooth/PS3Multi/PS3Multi.ino | 3 +++ examples/Bluetooth/PS3SPP/PS3SPP.ino | 3 +++ examples/Bluetooth/SPP/SPP.ino | 3 +++ examples/Bluetooth/SPPMulti/SPPMulti.ino | 3 +++ examples/Bluetooth/Wii/Wii.ino | 3 +++ examples/Bluetooth/WiiIRCamera/WiiIRCamera.ino | 4 ++++ examples/Bluetooth/WiiMulti/WiiMulti.ino | 3 +++ examples/Bluetooth/WiiUProController/WiiUProController.ino | 3 +++ 9 files changed, 28 insertions(+) diff --git a/examples/Bluetooth/PS3BT/PS3BT.ino b/examples/Bluetooth/PS3BT/PS3BT.ino index 9bd63261..df1b34fb 100644 --- a/examples/Bluetooth/PS3BT/PS3BT.ino +++ b/examples/Bluetooth/PS3BT/PS3BT.ino @@ -5,7 +5,10 @@ */ #include +#include + USB Usb; +USBHub Hub1(&Usb); // Some dongles have a hub inside BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so /* You can create the instance of the class in two ways */ PS3BT PS3(&Btd); // This will just create the instance diff --git a/examples/Bluetooth/PS3Multi/PS3Multi.ino b/examples/Bluetooth/PS3Multi/PS3Multi.ino index 6c4805bb..48335820 100644 --- a/examples/Bluetooth/PS3Multi/PS3Multi.ino +++ b/examples/Bluetooth/PS3Multi/PS3Multi.ino @@ -6,7 +6,10 @@ */ #include +#include + USB Usb; +USBHub Hub1(&Usb); // Some dongles have a hub inside BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so PS3BT *PS3[2]; // We will use this pointer to store the two instance, you can easily make it larger if you like, but it will use a lot of RAM! const uint8_t length = sizeof(PS3)/sizeof(PS3[0]); // Get the lenght of the array diff --git a/examples/Bluetooth/PS3SPP/PS3SPP.ino b/examples/Bluetooth/PS3SPP/PS3SPP.ino index ed02f739..e0ba1acb 100644 --- a/examples/Bluetooth/PS3SPP/PS3SPP.ino +++ b/examples/Bluetooth/PS3SPP/PS3SPP.ino @@ -11,7 +11,10 @@ #include #include +#include + USB Usb; +USBHub Hub1(&Usb); // Some dongles have a hub inside BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so /* You can create the instances of the bluetooth services in two ways */ diff --git a/examples/Bluetooth/SPP/SPP.ino b/examples/Bluetooth/SPP/SPP.ino index c7732955..fe3d4840 100644 --- a/examples/Bluetooth/SPP/SPP.ino +++ b/examples/Bluetooth/SPP/SPP.ino @@ -5,7 +5,10 @@ */ #include +#include + USB Usb; +USBHub Hub1(&Usb); // Some dongles have a hub inside BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so /* You can create the instance of the class in two ways */ SPP SerialBT(&Btd); // This will set the name to the defaults: "Arduino" and the pin to "1234" diff --git a/examples/Bluetooth/SPPMulti/SPPMulti.ino b/examples/Bluetooth/SPPMulti/SPPMulti.ino index 639ebdda..8e02d52b 100644 --- a/examples/Bluetooth/SPPMulti/SPPMulti.ino +++ b/examples/Bluetooth/SPPMulti/SPPMulti.ino @@ -5,7 +5,10 @@ */ #include +#include + USB Usb; +USBHub Hub1(&Usb); // Some dongles have a hub inside BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so SPP* SerialBT[2]; // We will use this pointer to store the two instance, you can easily make it larger if you like, but it will use a lot of RAM! const uint8_t length = sizeof(SerialBT)/sizeof(SerialBT[0]); // Get the lenght of the array diff --git a/examples/Bluetooth/Wii/Wii.ino b/examples/Bluetooth/Wii/Wii.ino index 8ed12d2f..082766e2 100644 --- a/examples/Bluetooth/Wii/Wii.ino +++ b/examples/Bluetooth/Wii/Wii.ino @@ -5,7 +5,10 @@ */ #include +#include + USB Usb; +USBHub Hub1(&Usb); // Some dongles have a hub inside BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so /* You can create the instance of the class in two ways */ WII Wii(&Btd,PAIR); // This will start an inquiry and then pair with your Wiimote - you only have to do this once diff --git a/examples/Bluetooth/WiiIRCamera/WiiIRCamera.ino b/examples/Bluetooth/WiiIRCamera/WiiIRCamera.ino index 720deaa6..f1a3ed72 100644 --- a/examples/Bluetooth/WiiIRCamera/WiiIRCamera.ino +++ b/examples/Bluetooth/WiiIRCamera/WiiIRCamera.ino @@ -12,10 +12,14 @@ Otherwise, wire up a IR LED yourself. */ #include +#include + #ifndef WIICAMERA // Used to check if WIICAMERA is defined #error "Uncomment WIICAMERA in Wii.h to use this example" #endif + USB Usb; +USBHub Hub1(&Usb); // Some dongles have a hub inside BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so /* You can create the instance of the class in two ways */ WII Wii(&Btd,PAIR); // This will start an inquiry and then pair with your Wiimote - you only have to do this once diff --git a/examples/Bluetooth/WiiMulti/WiiMulti.ino b/examples/Bluetooth/WiiMulti/WiiMulti.ino index 19813f19..2df008c2 100644 --- a/examples/Bluetooth/WiiMulti/WiiMulti.ino +++ b/examples/Bluetooth/WiiMulti/WiiMulti.ino @@ -6,7 +6,10 @@ */ #include +#include + USB Usb; +USBHub Hub1(&Usb); // Some dongles have a hub inside BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so WII *Wii[2]; // We will use this pointer to store the two instance, you can easily make it larger if you like, but it will use a lot of RAM! const uint8_t length = sizeof(Wii)/sizeof(Wii[0]); // Get the lenght of the array diff --git a/examples/Bluetooth/WiiUProController/WiiUProController.ino b/examples/Bluetooth/WiiUProController/WiiUProController.ino index 738bc899..86e22253 100644 --- a/examples/Bluetooth/WiiUProController/WiiUProController.ino +++ b/examples/Bluetooth/WiiUProController/WiiUProController.ino @@ -5,7 +5,10 @@ */ #include +#include + USB Usb; +USBHub Hub1(&Usb); // Some dongles have a hub inside BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so /* You can create the instance of the class in two ways */ WII Wii(&Btd,PAIR); // This will start an inquiry and then pair with your Wiimote - you only have to do this once From 4d4a329b266384b70f5b567710ab72d2de6c37d0 Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Tue, 13 Aug 2013 21:33:21 +0200 Subject: [PATCH 06/13] Add USBHub to keywords --- keywords.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/keywords.txt b/keywords.txt index bdd899c7..fb28eec1 100644 --- a/keywords.txt +++ b/keywords.txt @@ -7,6 +7,7 @@ #################################################### USB KEYWORD1 +USBHub KEYWORD1 #################################################### # Syntax Coloring Map For BTD (Bluetooth) Library From 40b043640097618f904401d674148a991513bbb8 Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Tue, 13 Aug 2013 22:31:51 +0200 Subject: [PATCH 07/13] Fixed bug when using Wiicamera with new Wiimote with MotionPlus inside --- Wii.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Wii.cpp b/Wii.cpp index 367683d2..0b911e25 100755 --- a/Wii.cpp +++ b/Wii.cpp @@ -357,7 +357,10 @@ void WII::ACLData(uint8_t* l2capinbuf) { Notify(PSTR("\r\nMotion Plus activated in normal mode"), 0x80); #endif motionPlusConnected = true; - setReportMode(false, 0x35); // Also read the extension +#ifdef WIICAMERA + if (!isIRCameraEnabled()) // Don't activate the Motion Plus if we are trying to initialize the IR camera +#endif + setReportMode(false, 0x35); // Also read the extension } else if (l2capinbuf[16] == 0x00 && l2capinbuf[17] == 0xA4 && l2capinbuf[18] == 0x20 && l2capinbuf[19] == 0x05 && l2capinbuf[20] == 0x05) { #ifdef DEBUG_USB_HOST Notify(PSTR("\r\nMotion Plus activated in Nunchuck pass-through mode"), 0x80); @@ -365,7 +368,10 @@ void WII::ACLData(uint8_t* l2capinbuf) { activateNunchuck = false; motionPlusConnected = true; nunchuckConnected = true; - setReportMode(false, 0x35); // Also read the extension +#ifdef WIICAMERA + if (!isIRCameraEnabled()) // Don't activate the Motion Plus if we are trying to initialize the IR camera +#endif + setReportMode(false, 0x35); // Also read the extension } else if (l2capinbuf[16] == 0x00 && l2capinbuf[17] == 0xA6 && l2capinbuf[18] == 0x20 && (l2capinbuf[19] == 0x00 || l2capinbuf[19] == 0x04 || l2capinbuf[19] == 0x05 || l2capinbuf[19] == 0x07) && l2capinbuf[20] == 0x05) { #ifdef DEBUG_USB_HOST Notify(PSTR("\r\nInactive Wii Motion Plus"), 0x80); From e1e159b56062e3a9086e07a96a2448a139d27d07 Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Tue, 13 Aug 2013 22:42:49 +0200 Subject: [PATCH 08/13] Fixed problem with IOGEAR GBU521 --- BTD.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/BTD.cpp b/BTD.cpp index 9cb0134d..21f080b7 100755 --- a/BTD.cpp +++ b/BTD.cpp @@ -195,8 +195,18 @@ uint8_t BTD::Init(uint8_t parent, uint8_t port, bool lowspeed) { break; } - if (bNumEP < BTD_MAX_ENDPOINTS) - goto FailUnknownDevice; + if (bNumEP < BTD_MAX_ENDPOINTS) { + for (uint8_t i = 0; i < num_of_conf; i++) { + ConfigDescParser confDescrParser(this); // Needed for the IOGEAR GBU521 + rcode = pUsb->getConfDescr(bAddress, 0, i, &confDescrParser); + if (rcode) + goto FailGetConfDescr; + if (bNumEP >= BTD_MAX_ENDPOINTS) // All endpoints extracted + break; + } + if (bNumEP < BTD_MAX_ENDPOINTS) + goto FailUnknownDevice; + } // Assign epInfo to epinfo pointer - this time all 3 endpoins rcode = pUsb->setEpInfoEntry(bAddress, bNumEP, epInfo); From 64cdcf51f4474b31f31171d003b1c627eb64bada Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Wed, 14 Aug 2013 00:43:15 +0200 Subject: [PATCH 09/13] Check for IOGEAR GBU521 manually --- BTD.cpp | 25 ++++++++++--------------- BTD.h | 15 +++++++++------ 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/BTD.cpp b/BTD.cpp index 21f080b7..b283ced4 100755 --- a/BTD.cpp +++ b/BTD.cpp @@ -187,26 +187,21 @@ uint8_t BTD::Init(uint8_t parent, uint8_t port, bool lowspeed) { // First interface in the configuration must have Bluetooth assigned Class/Subclass/Protocol // And 3 endpoints - interrupt-IN, bulk-IN, bulk-OUT, not necessarily in this order for (uint8_t i = 0; i < num_of_conf; i++) { - ConfigDescParser confDescrParser(this); - rcode = pUsb->getConfDescr(bAddress, 0, i, &confDescrParser); - if (rcode) + if (VID == IOGEAR_GBU521_VID && PID == IOGEAR_GBU521_PID) { + ConfigDescParser confDescrParser(this); // Needed for the IOGEAR GBU521 + rcode = pUsb->getConfDescr(bAddress, 0, i, &confDescrParser); + } else { + ConfigDescParser confDescrParser(this); + rcode = pUsb->getConfDescr(bAddress, 0, i, &confDescrParser); + } + if (rcode) // Check error code goto FailGetConfDescr; if (bNumEP >= BTD_MAX_ENDPOINTS) // All endpoints extracted break; } - if (bNumEP < BTD_MAX_ENDPOINTS) { - for (uint8_t i = 0; i < num_of_conf; i++) { - ConfigDescParser confDescrParser(this); // Needed for the IOGEAR GBU521 - rcode = pUsb->getConfDescr(bAddress, 0, i, &confDescrParser); - if (rcode) - goto FailGetConfDescr; - if (bNumEP >= BTD_MAX_ENDPOINTS) // All endpoints extracted - break; - } - if (bNumEP < BTD_MAX_ENDPOINTS) - goto FailUnknownDevice; - } + if (bNumEP < BTD_MAX_ENDPOINTS) + goto FailUnknownDevice; // Assign epInfo to epinfo pointer - this time all 3 endpoins rcode = pUsb->setEpInfoEntry(bAddress, bNumEP, epInfo); diff --git a/BTD.h b/BTD.h index cdfee0b8..556178bf 100755 --- a/BTD.h +++ b/BTD.h @@ -22,13 +22,16 @@ #include "confdescparser.h" //PID and VID of the Sony PS3 devices -#define PS3_VID 0x054C // Sony Corporation -#define PS3_PID 0x0268 // PS3 Controller DualShock 3 -#define PS3NAVIGATION_PID 0x042F // Navigation controller -#define PS3MOVE_PID 0x03D5 // Motion controller +#define PS3_VID 0x054C // Sony Corporation +#define PS3_PID 0x0268 // PS3 Controller DualShock 3 +#define PS3NAVIGATION_PID 0x042F // Navigation controller +#define PS3MOVE_PID 0x03D5 // Motion controller + +#define IOGEAR_GBU521_VID 0x0A5C // The IOGEAR GBU521 dongle does not presents itself correctly, so we have to check for it manually +#define IOGEAR_GBU521_PID 0x4500 /* Bluetooth dongle data taken from descriptors */ -#define BULK_MAXPKTSIZE 64 // max size for ACL data +#define BULK_MAXPKTSIZE 64 // max size for ACL data // Used in control endpoint header for HCI Commands #define bmREQ_HCI_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_DEVICE @@ -209,7 +212,7 @@ public: * @return Returns true if the device's VID and PID matches this driver. */ virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) { - return (vid == PS3_VID && (pid == PS3_PID || pid == PS3NAVIGATION_PID || pid == PS3MOVE_PID)); + return ((vid == PS3_VID || vid == IOGEAR_GBU521_VID) && (pid == PS3_PID || pid == PS3NAVIGATION_PID || pid == PS3MOVE_PID || pid == IOGEAR_GBU521_PID)); }; /**@}*/ From 6e271b44aa943e36e9e3cf2b4f256d28b1359adc Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Wed, 14 Aug 2013 00:57:11 +0200 Subject: [PATCH 10/13] Fixed PID --- BTD.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BTD.h b/BTD.h index 556178bf..a56c1ba4 100755 --- a/BTD.h +++ b/BTD.h @@ -28,7 +28,7 @@ #define PS3MOVE_PID 0x03D5 // Motion controller #define IOGEAR_GBU521_VID 0x0A5C // The IOGEAR GBU521 dongle does not presents itself correctly, so we have to check for it manually -#define IOGEAR_GBU521_PID 0x4500 +#define IOGEAR_GBU521_PID 0x21E8 /* Bluetooth dongle data taken from descriptors */ #define BULK_MAXPKTSIZE 64 // max size for ACL data From 4d91186cd137e91963730f52f280d28f57428adb Mon Sep 17 00:00:00 2001 From: Oleg Mazurov Date: Wed, 14 Aug 2013 14:02:42 -0600 Subject: [PATCH 11/13] fixed PrintHex in Kbd example --- BTD.h | 2 +- adk.cpp | 12 ++++++------ cdcacm.cpp | 12 ++++++------ cdcftdi.cpp | 12 ++++++------ confdescparser.h | 14 +++++++------- examples/HID/USBHIDBootKbd/USBHIDBootKbd.ino | 2 +- .../HID/USBHIDJoystick/hidjoystickrptparser.cpp | 12 ++++++------ examples/HID/le3dp/le3dp_rptparser.cpp | 14 +++++++------- 8 files changed, 40 insertions(+), 40 deletions(-) diff --git a/BTD.h b/BTD.h index 556178bf..87c2f4d4 100755 --- a/BTD.h +++ b/BTD.h @@ -28,7 +28,7 @@ #define PS3MOVE_PID 0x03D5 // Motion controller #define IOGEAR_GBU521_VID 0x0A5C // The IOGEAR GBU521 dongle does not presents itself correctly, so we have to check for it manually -#define IOGEAR_GBU521_PID 0x4500 +#define IOGEAR_GBU521_PID 0x21e8 /* Bluetooth dongle data taken from descriptors */ #define BULK_MAXPKTSIZE 64 // max size for ACL data diff --git a/adk.cpp b/adk.cpp index 8bce6723..453833dc 100644 --- a/adk.cpp +++ b/adk.cpp @@ -335,16 +335,16 @@ uint8_t ADK::SndData(uint16_t nbytes, uint8_t *dataptr) { void ADK::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr) { Notify(PSTR("Endpoint descriptor:"), 0x80); Notify(PSTR("\r\nLength:\t\t"), 0x80); - D_PrintHex (ep_ptr->bLength, 0x80); + PrintHex (ep_ptr->bLength, 0x80); Notify(PSTR("\r\nType:\t\t"), 0x80); - D_PrintHex (ep_ptr->bDescriptorType, 0x80); + PrintHex (ep_ptr->bDescriptorType, 0x80); Notify(PSTR("\r\nAddress:\t"), 0x80); - D_PrintHex (ep_ptr->bEndpointAddress, 0x80); + PrintHex (ep_ptr->bEndpointAddress, 0x80); Notify(PSTR("\r\nAttributes:\t"), 0x80); - D_PrintHex (ep_ptr->bmAttributes, 0x80); + PrintHex (ep_ptr->bmAttributes, 0x80); Notify(PSTR("\r\nMaxPktSize:\t"), 0x80); - D_PrintHex (ep_ptr->wMaxPacketSize, 0x80); + PrintHex (ep_ptr->wMaxPacketSize, 0x80); Notify(PSTR("\r\nPoll Intrv:\t"), 0x80); - D_PrintHex (ep_ptr->bInterval, 0x80); + PrintHex (ep_ptr->bInterval, 0x80); Notify(PSTR("\r\n"), 0x80); } diff --git a/cdcacm.cpp b/cdcacm.cpp index 1a4e9575..0f9fffde 100644 --- a/cdcacm.cpp +++ b/cdcacm.cpp @@ -334,16 +334,16 @@ uint8_t ACM::SendBreak(uint16_t duration) { void ACM::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr) { Notify(PSTR("Endpoint descriptor:"), 0x80); Notify(PSTR("\r\nLength:\t\t"), 0x80); - D_PrintHex (ep_ptr->bLength, 0x80); + PrintHex (ep_ptr->bLength, 0x80); Notify(PSTR("\r\nType:\t\t"), 0x80); - D_PrintHex (ep_ptr->bDescriptorType, 0x80); + PrintHex (ep_ptr->bDescriptorType, 0x80); Notify(PSTR("\r\nAddress:\t"), 0x80); - D_PrintHex (ep_ptr->bEndpointAddress, 0x80); + PrintHex (ep_ptr->bEndpointAddress, 0x80); Notify(PSTR("\r\nAttributes:\t"), 0x80); - D_PrintHex (ep_ptr->bmAttributes, 0x80); + PrintHex (ep_ptr->bmAttributes, 0x80); Notify(PSTR("\r\nMaxPktSize:\t"), 0x80); - D_PrintHex (ep_ptr->wMaxPacketSize, 0x80); + PrintHex (ep_ptr->wMaxPacketSize, 0x80); Notify(PSTR("\r\nPoll Intrv:\t"), 0x80); - D_PrintHex (ep_ptr->bInterval, 0x80); + PrintHex (ep_ptr->bInterval, 0x80); Notify(PSTR("\r\n"), 0x80); } diff --git a/cdcftdi.cpp b/cdcftdi.cpp index ae8c5962..20d1dd66 100644 --- a/cdcftdi.cpp +++ b/cdcftdi.cpp @@ -326,16 +326,16 @@ uint8_t FTDI::SndData(uint16_t nbytes, uint8_t *dataptr) { void FTDI::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr) { Notify(PSTR("Endpoint descriptor:"), 0x80); Notify(PSTR("\r\nLength:\t\t"), 0x80); - D_PrintHex (ep_ptr->bLength, 0x80); + PrintHex (ep_ptr->bLength, 0x80); Notify(PSTR("\r\nType:\t\t"), 0x80); - D_PrintHex (ep_ptr->bDescriptorType, 0x80); + PrintHex (ep_ptr->bDescriptorType, 0x80); Notify(PSTR("\r\nAddress:\t"), 0x80); - D_PrintHex (ep_ptr->bEndpointAddress, 0x80); + PrintHex (ep_ptr->bEndpointAddress, 0x80); Notify(PSTR("\r\nAttributes:\t"), 0x80); - D_PrintHex (ep_ptr->bmAttributes, 0x80); + PrintHex (ep_ptr->bmAttributes, 0x80); Notify(PSTR("\r\nMaxPktSize:\t"), 0x80); - D_PrintHex (ep_ptr->wMaxPacketSize, 0x80); + PrintHex (ep_ptr->wMaxPacketSize, 0x80); Notify(PSTR("\r\nPoll Intrv:\t"), 0x80); - D_PrintHex (ep_ptr->bInterval, 0x80); + PrintHex (ep_ptr->bInterval, 0x80); Notify(PSTR("\r\n"), 0x80); } diff --git a/confdescparser.h b/confdescparser.h index a3bc7cc7..7fcb6a27 100644 --- a/confdescparser.h +++ b/confdescparser.h @@ -175,19 +175,19 @@ template ::PrintHidDescriptor(const USB_HID_DESCRIPTOR *pDesc) { Notify(PSTR("\r\n\r\nHID Descriptor:\r\n"), 0x80); Notify(PSTR("bDescLength:\t\t"), 0x80); - D_PrintHex (pDesc->bLength, 0x80); + PrintHex (pDesc->bLength, 0x80); Notify(PSTR("\r\nbDescriptorType:\t"), 0x80); - D_PrintHex (pDesc->bDescriptorType, 0x80); + PrintHex (pDesc->bDescriptorType, 0x80); Notify(PSTR("\r\nbcdHID:\t\t\t"), 0x80); - D_PrintHex (pDesc->bcdHID, 0x80); + PrintHex (pDesc->bcdHID, 0x80); Notify(PSTR("\r\nbCountryCode:\t\t"), 0x80); - D_PrintHex (pDesc->bCountryCode, 0x80); + PrintHex (pDesc->bCountryCode, 0x80); Notify(PSTR("\r\nbNumDescriptors:\t"), 0x80); - D_PrintHex (pDesc->bNumDescriptors, 0x80); + PrintHex (pDesc->bNumDescriptors, 0x80); //Notify(PSTR("\r\nbDescrType:\t\t")); //PrintHex(pDesc->bDescrType); @@ -199,10 +199,10 @@ void ConfigDescParser::PrintHidDescrip HID_CLASS_DESCRIPTOR_LEN_AND_TYPE *pLT = (HID_CLASS_DESCRIPTOR_LEN_AND_TYPE*)&(pDesc->bDescrType); Notify(PSTR("\r\nbDescrType:\t\t"), 0x80); - D_PrintHex (pLT[i].bDescrType, 0x80); + PrintHex (pLT[i].bDescrType, 0x80); Notify(PSTR("\r\nwDescriptorLength:\t"), 0x80); - D_PrintHex (pLT[i].wDescriptorLength, 0x80); + PrintHex (pLT[i].wDescriptorLength, 0x80); } Notify(PSTR("\r\n"), 0x80); } diff --git a/examples/HID/USBHIDBootKbd/USBHIDBootKbd.ino b/examples/HID/USBHIDBootKbd/USBHIDBootKbd.ino index 35155d8b..3820eb5c 100644 --- a/examples/HID/USBHIDBootKbd/USBHIDBootKbd.ino +++ b/examples/HID/USBHIDBootKbd/USBHIDBootKbd.ino @@ -37,7 +37,7 @@ void KbdRptParser::PrintKey(uint8_t m, uint8_t key) Serial.print((mod.bmLeftGUI == 1) ? "G" : " "); Serial.print(" >"); - D_PrintHex(key, 0x80); + PrintHex(key, 0x80); Serial.print("< "); Serial.print((mod.bmRightCtrl == 1) ? "C" : " "); diff --git a/examples/HID/USBHIDJoystick/hidjoystickrptparser.cpp b/examples/HID/USBHIDJoystick/hidjoystickrptparser.cpp index 684dd527..ef6444b5 100644 --- a/examples/HID/USBHIDJoystick/hidjoystickrptparser.cpp +++ b/examples/HID/USBHIDJoystick/hidjoystickrptparser.cpp @@ -63,22 +63,22 @@ void JoystickReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t void JoystickEvents::OnGamePadChanged(const GamePadEventData *evt) { Serial.print("X: "); - D_PrintHex(evt->X, 0x80); + PrintHex(evt->X, 0x80); Serial.print("\tY: "); - D_PrintHex(evt->Y, 0x80); + PrintHex(evt->Y, 0x80); Serial.print("\tZ: "); - D_PrintHex(evt->Z1, 0x80); + PrintHex(evt->Z1, 0x80); Serial.print("\tZ: "); - D_PrintHex(evt->Z2, 0x80); + PrintHex(evt->Z2, 0x80); Serial.print("\tRz: "); - D_PrintHex(evt->Rz, 0x80); + PrintHex(evt->Rz, 0x80); Serial.println(""); } void JoystickEvents::OnHatSwitch(uint8_t hat) { Serial.print("Hat Switch: "); - D_PrintHex(hat, 0x80); + PrintHex(hat, 0x80); Serial.println(""); } diff --git a/examples/HID/le3dp/le3dp_rptparser.cpp b/examples/HID/le3dp/le3dp_rptparser.cpp index b42478ed..baece13b 100644 --- a/examples/HID/le3dp/le3dp_rptparser.cpp +++ b/examples/HID/le3dp/le3dp_rptparser.cpp @@ -26,18 +26,18 @@ void JoystickReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t void JoystickEvents::OnGamePadChanged(const GamePadEventData *evt) { Serial.print("X: "); - D_PrintHex(evt->x, 0x80); + PrintHex(evt->x, 0x80); Serial.print(" Y: "); - D_PrintHex(evt->y, 0x80); + PrintHex(evt->y, 0x80); Serial.print(" Hat Switch: "); - D_PrintHex(evt->hat, 0x80); + PrintHex(evt->hat, 0x80); Serial.print(" Twist: "); - D_PrintHex(evt->twist, 0x80); + PrintHex(evt->twist, 0x80); Serial.print(" Slider: "); - D_PrintHex(evt->slider, 0x80); + PrintHex(evt->slider, 0x80); Serial.print(" Buttons A: "); - D_PrintHex(evt->buttons_a, 0x80); + PrintHex(evt->buttons_a, 0x80); Serial.print(" Buttons B: "); - D_PrintHex(evt->buttons_b, 0x80); + PrintHex(evt->buttons_b, 0x80); Serial.println(""); } From 900ba05c9be47d9f6087d4ea8cf62b30bd1424ec Mon Sep 17 00:00:00 2001 From: Oleg Mazurov Date: Wed, 14 Aug 2013 14:08:37 -0600 Subject: [PATCH 12/13] fixed PrintHex in kbd example --- examples/HID/USBHIDBootKbd/USBHIDBootKbd.ino | 2 +- .../HID/USBHIDJoystick/hidjoystickrptparser.cpp | 12 ++++++------ examples/HID/le3dp/le3dp_rptparser.cpp | 14 +++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/HID/USBHIDBootKbd/USBHIDBootKbd.ino b/examples/HID/USBHIDBootKbd/USBHIDBootKbd.ino index 35155d8b..3820eb5c 100644 --- a/examples/HID/USBHIDBootKbd/USBHIDBootKbd.ino +++ b/examples/HID/USBHIDBootKbd/USBHIDBootKbd.ino @@ -37,7 +37,7 @@ void KbdRptParser::PrintKey(uint8_t m, uint8_t key) Serial.print((mod.bmLeftGUI == 1) ? "G" : " "); Serial.print(" >"); - D_PrintHex(key, 0x80); + PrintHex(key, 0x80); Serial.print("< "); Serial.print((mod.bmRightCtrl == 1) ? "C" : " "); diff --git a/examples/HID/USBHIDJoystick/hidjoystickrptparser.cpp b/examples/HID/USBHIDJoystick/hidjoystickrptparser.cpp index 684dd527..ef6444b5 100644 --- a/examples/HID/USBHIDJoystick/hidjoystickrptparser.cpp +++ b/examples/HID/USBHIDJoystick/hidjoystickrptparser.cpp @@ -63,22 +63,22 @@ void JoystickReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t void JoystickEvents::OnGamePadChanged(const GamePadEventData *evt) { Serial.print("X: "); - D_PrintHex(evt->X, 0x80); + PrintHex(evt->X, 0x80); Serial.print("\tY: "); - D_PrintHex(evt->Y, 0x80); + PrintHex(evt->Y, 0x80); Serial.print("\tZ: "); - D_PrintHex(evt->Z1, 0x80); + PrintHex(evt->Z1, 0x80); Serial.print("\tZ: "); - D_PrintHex(evt->Z2, 0x80); + PrintHex(evt->Z2, 0x80); Serial.print("\tRz: "); - D_PrintHex(evt->Rz, 0x80); + PrintHex(evt->Rz, 0x80); Serial.println(""); } void JoystickEvents::OnHatSwitch(uint8_t hat) { Serial.print("Hat Switch: "); - D_PrintHex(hat, 0x80); + PrintHex(hat, 0x80); Serial.println(""); } diff --git a/examples/HID/le3dp/le3dp_rptparser.cpp b/examples/HID/le3dp/le3dp_rptparser.cpp index b42478ed..baece13b 100644 --- a/examples/HID/le3dp/le3dp_rptparser.cpp +++ b/examples/HID/le3dp/le3dp_rptparser.cpp @@ -26,18 +26,18 @@ void JoystickReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t void JoystickEvents::OnGamePadChanged(const GamePadEventData *evt) { Serial.print("X: "); - D_PrintHex(evt->x, 0x80); + PrintHex(evt->x, 0x80); Serial.print(" Y: "); - D_PrintHex(evt->y, 0x80); + PrintHex(evt->y, 0x80); Serial.print(" Hat Switch: "); - D_PrintHex(evt->hat, 0x80); + PrintHex(evt->hat, 0x80); Serial.print(" Twist: "); - D_PrintHex(evt->twist, 0x80); + PrintHex(evt->twist, 0x80); Serial.print(" Slider: "); - D_PrintHex(evt->slider, 0x80); + PrintHex(evt->slider, 0x80); Serial.print(" Buttons A: "); - D_PrintHex(evt->buttons_a, 0x80); + PrintHex(evt->buttons_a, 0x80); Serial.print(" Buttons B: "); - D_PrintHex(evt->buttons_b, 0x80); + PrintHex(evt->buttons_b, 0x80); Serial.println(""); } From 16ed30dc5810745108af53519c9c0f35e2771d31 Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Fri, 16 Aug 2013 23:26:09 +0200 Subject: [PATCH 13/13] Minor --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 29abf19d..310fac72 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Documentation for the library can be found at the following link: