From 3cf30dff259cb8d902880934631ef332782f9a12 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Wed, 1 Jul 2015 16:56:14 +0200 Subject: [PATCH] rename Setup typedef struct to USBSetup was really too common --- cores/arduino/CDC.cpp | 4 ++-- cores/arduino/PluggableUSB.cpp | 2 +- cores/arduino/PluggableUSB.h | 4 ++-- cores/arduino/USBAPI.h | 6 +++--- cores/arduino/USBCore.cpp | 6 +++--- libraries/HID/HID.cpp | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cores/arduino/CDC.cpp b/cores/arduino/CDC.cpp index 2ea1353..22f3591 100644 --- a/cores/arduino/CDC.cpp +++ b/cores/arduino/CDC.cpp @@ -53,13 +53,13 @@ const CDCDescriptor _cdcInterface = D_ENDPOINT(USB_ENDPOINT_IN (CDC_ENDPOINT_IN ),USB_ENDPOINT_TYPE_BULK,0x40,0) }; -int WEAK CDC_GetInterface(u8* interfaceNum) +int CDC_GetInterface(u8* interfaceNum) { interfaceNum[0] += 2; // uses 2 return USB_SendControl(TRANSFER_PGM,&_cdcInterface,sizeof(_cdcInterface)); } -bool WEAK CDC_Setup(Setup& setup) +bool CDC_Setup(USBSetup& setup) { u8 r = setup.bRequest; u8 requestType = setup.bmRequestType; diff --git a/cores/arduino/PluggableUSB.cpp b/cores/arduino/PluggableUSB.cpp index 970c11e..68a6c8a 100644 --- a/cores/arduino/PluggableUSB.cpp +++ b/cores/arduino/PluggableUSB.cpp @@ -58,7 +58,7 @@ int PUSB_GetDescriptor(int8_t t) return ret; } -bool PUSB_Setup(Setup& setup, u8 j) +bool PUSB_Setup(USBSetup& setup, u8 j) { bool ret = false; PUSBListNode* node = rootNode; diff --git a/cores/arduino/PluggableUSB.h b/cores/arduino/PluggableUSB.h index b9a27c1..647980b 100644 --- a/cores/arduino/PluggableUSB.h +++ b/cores/arduino/PluggableUSB.h @@ -27,7 +27,7 @@ typedef struct { - bool (*setup)(Setup& setup, u8 i); + bool (*setup)(USBSetup& setup, u8 i); int (*getInterface)(u8* interfaceNum); int (*getDescriptor)(int8_t t); int8_t numEndpoints; @@ -54,7 +54,7 @@ int PUSB_GetInterface(u8* interfaceNum); int PUSB_GetDescriptor(int8_t t); -bool PUSB_Setup(Setup& setup, u8 i); +bool PUSB_Setup(USBSetup& setup, u8 i); void PUSB_Begin(); diff --git a/cores/arduino/USBAPI.h b/cores/arduino/USBAPI.h index 251e4b9..4abd961 100644 --- a/cores/arduino/USBAPI.h +++ b/cores/arduino/USBAPI.h @@ -118,7 +118,7 @@ typedef struct uint8_t wValueH; uint16_t wIndex; uint16_t wLength; -} Setup; +} USBSetup; //================================================================================ //================================================================================ @@ -126,7 +126,7 @@ typedef struct int MSC_GetInterface(uint8_t* interfaceNum); int MSC_GetDescriptor(int i); -bool MSC_Setup(Setup& setup); +bool MSC_Setup(USBSetup& setup); bool MSC_Data(uint8_t rx,uint8_t tx); //================================================================================ @@ -135,7 +135,7 @@ bool MSC_Data(uint8_t rx,uint8_t tx); int CDC_GetInterface(uint8_t* interfaceNum); int CDC_GetDescriptor(int i); -bool CDC_Setup(Setup& setup); +bool CDC_Setup(USBSetup& setup); //================================================================================ //================================================================================ diff --git a/cores/arduino/USBCore.cpp b/cores/arduino/USBCore.cpp index 9095d79..8237ccb 100644 --- a/cores/arduino/USBCore.cpp +++ b/cores/arduino/USBCore.cpp @@ -352,7 +352,7 @@ void InitEndpoints() // Handle CLASS_INTERFACE requests static -bool ClassInterfaceRequest(Setup& setup) +bool ClassInterfaceRequest(USBSetup& setup) { u8 i = setup.wIndex; @@ -465,7 +465,7 @@ bool SendConfiguration(int maxlen) u8 _cdcComposite = 0; static -bool SendDescriptor(Setup& setup) +bool SendDescriptor(USBSetup& setup) { int ret; u8 t = setup.wValueH; @@ -517,7 +517,7 @@ ISR(USB_COM_vect) if (!ReceivedSetupInt()) return; - Setup setup; + USBSetup setup; Recv((u8*)&setup,8); ClearSetupInt(); diff --git a/libraries/HID/HID.cpp b/libraries/HID/HID.cpp index c1ac51a..e75a6f5 100644 --- a/libraries/HID/HID.cpp +++ b/libraries/HID/HID.cpp @@ -72,7 +72,7 @@ void HID_SendReport(u8 id, const void* data, int len) USB_Send(HID_TX | TRANSFER_RELEASE,data,len); } -bool HID_Setup(Setup& setup, u8 i) +bool HID_Setup(USBSetup& setup, u8 i) { if (HID_INTERFACE != i) { return false;