rename Setup typedef struct to USBSetup

was really too common
This commit is contained in:
Martino Facchin 2015-07-01 16:56:14 +02:00 committed by Cristian Maglie
parent 3d0331b8f6
commit 3cf30dff25
6 changed files with 12 additions and 12 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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();

View File

@ -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);
//================================================================================
//================================================================================

View File

@ -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();

View File

@ -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;