mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-07 01:54:26 +01:00
rename Setup typedef struct to USBSetup
was really too common
This commit is contained in:
parent
dee43a19d7
commit
97a3771772
@ -53,13 +53,13 @@ const CDCDescriptor _cdcInterface =
|
|||||||
D_ENDPOINT(USB_ENDPOINT_IN (CDC_ENDPOINT_IN ),USB_ENDPOINT_TYPE_BULK,0x40,0)
|
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
|
interfaceNum[0] += 2; // uses 2
|
||||||
return USB_SendControl(TRANSFER_PGM,&_cdcInterface,sizeof(_cdcInterface));
|
return USB_SendControl(TRANSFER_PGM,&_cdcInterface,sizeof(_cdcInterface));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WEAK CDC_Setup(Setup& setup)
|
bool CDC_Setup(USBSetup& setup)
|
||||||
{
|
{
|
||||||
u8 r = setup.bRequest;
|
u8 r = setup.bRequest;
|
||||||
u8 requestType = setup.bmRequestType;
|
u8 requestType = setup.bmRequestType;
|
||||||
|
@ -58,7 +58,7 @@ int PUSB_GetDescriptor(int8_t t)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PUSB_Setup(Setup& setup, u8 j)
|
bool PUSB_Setup(USBSetup& setup, u8 j)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
PUSBListNode* node = rootNode;
|
PUSBListNode* node = rootNode;
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
bool (*setup)(Setup& setup, u8 i);
|
bool (*setup)(USBSetup& setup, u8 i);
|
||||||
int (*getInterface)(u8* interfaceNum);
|
int (*getInterface)(u8* interfaceNum);
|
||||||
int (*getDescriptor)(int8_t t);
|
int (*getDescriptor)(int8_t t);
|
||||||
int8_t numEndpoints;
|
int8_t numEndpoints;
|
||||||
@ -54,7 +54,7 @@ int PUSB_GetInterface(u8* interfaceNum);
|
|||||||
|
|
||||||
int PUSB_GetDescriptor(int8_t t);
|
int PUSB_GetDescriptor(int8_t t);
|
||||||
|
|
||||||
bool PUSB_Setup(Setup& setup, u8 i);
|
bool PUSB_Setup(USBSetup& setup, u8 i);
|
||||||
|
|
||||||
void PUSB_Begin();
|
void PUSB_Begin();
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ typedef struct
|
|||||||
uint8_t wValueH;
|
uint8_t wValueH;
|
||||||
uint16_t wIndex;
|
uint16_t wIndex;
|
||||||
uint16_t wLength;
|
uint16_t wLength;
|
||||||
} Setup;
|
} USBSetup;
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
//================================================================================
|
//================================================================================
|
||||||
@ -126,7 +126,7 @@ typedef struct
|
|||||||
|
|
||||||
int MSC_GetInterface(uint8_t* interfaceNum);
|
int MSC_GetInterface(uint8_t* interfaceNum);
|
||||||
int MSC_GetDescriptor(int i);
|
int MSC_GetDescriptor(int i);
|
||||||
bool MSC_Setup(Setup& setup);
|
bool MSC_Setup(USBSetup& setup);
|
||||||
bool MSC_Data(uint8_t rx,uint8_t tx);
|
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_GetInterface(uint8_t* interfaceNum);
|
||||||
int CDC_GetDescriptor(int i);
|
int CDC_GetDescriptor(int i);
|
||||||
bool CDC_Setup(Setup& setup);
|
bool CDC_Setup(USBSetup& setup);
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
@ -352,7 +352,7 @@ void InitEndpoints()
|
|||||||
|
|
||||||
// Handle CLASS_INTERFACE requests
|
// Handle CLASS_INTERFACE requests
|
||||||
static
|
static
|
||||||
bool ClassInterfaceRequest(Setup& setup)
|
bool ClassInterfaceRequest(USBSetup& setup)
|
||||||
{
|
{
|
||||||
u8 i = setup.wIndex;
|
u8 i = setup.wIndex;
|
||||||
|
|
||||||
@ -465,7 +465,7 @@ bool SendConfiguration(int maxlen)
|
|||||||
u8 _cdcComposite = 0;
|
u8 _cdcComposite = 0;
|
||||||
|
|
||||||
static
|
static
|
||||||
bool SendDescriptor(Setup& setup)
|
bool SendDescriptor(USBSetup& setup)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
u8 t = setup.wValueH;
|
u8 t = setup.wValueH;
|
||||||
@ -517,7 +517,7 @@ ISR(USB_COM_vect)
|
|||||||
if (!ReceivedSetupInt())
|
if (!ReceivedSetupInt())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Setup setup;
|
USBSetup setup;
|
||||||
Recv((u8*)&setup,8);
|
Recv((u8*)&setup,8);
|
||||||
ClearSetupInt();
|
ClearSetupInt();
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ void HID_SendReport(u8 id, const void* data, int len)
|
|||||||
USB_Send(HID_TX | TRANSFER_RELEASE,data,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) {
|
if (HID_INTERFACE != i) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user