remove useless variables

This commit is contained in:
Martino Facchin 2015-06-08 11:30:34 +02:00 committed by Cristian Maglie
parent a1ba49e7c8
commit 353ef39c23
2 changed files with 11 additions and 14 deletions

View File

@ -25,9 +25,6 @@
#define MAX_MODULES 6
static u8 startIf = CDC_ACM_INTERFACE + CDC_INTERFACE_COUNT;
static u8 firstEp = CDC_FIRST_ENDPOINT + CDC_ENPOINT_COUNT;
static u8 lastIf = CDC_ACM_INTERFACE + CDC_INTERFACE_COUNT;
static u8 lastEp = CDC_FIRST_ENDPOINT + CDC_ENPOINT_COUNT;
@ -36,18 +33,18 @@ extern u8 _initEndpoints[];
PUSBCallbacks cbs[MAX_MODULES];
u8 modules_count = 0;
int PUSB_GetInterface(u8* interfaceNum)
int8_t PUSB_GetInterface(u8* interfaceNum)
{
int ret = 0;
int8_t ret = 0;
for (u8 i=0; i<modules_count; i++) {
ret = cbs[i].getInterface(interfaceNum);
}
return ret;
}
int PUSB_GetDescriptor(int t)
int8_t PUSB_GetDescriptor(int8_t t)
{
int ret = 0;
int8_t ret = 0;
for (u8 i=0; i<modules_count && ret == 0; i++) {
ret = cbs[i].getDescriptor(t);
}
@ -63,7 +60,7 @@ bool PUSB_Setup(Setup& setup, u8 j)
return ret;
}
int PUSB_AddFunction(PUSBCallbacks *cb, u8* interface)
int8_t PUSB_AddFunction(PUSBCallbacks *cb, u8* interface)
{
if (modules_count >= MAX_MODULES) {
return 0;

View File

@ -28,9 +28,9 @@
typedef struct
{
bool (*setup)(Setup& setup, u8 i);
int (*getInterface)(u8* interfaceNum);
int (*getDescriptor)(int t);
int numEndpoints;
int8_t (*getInterface)(u8* interfaceNum);
int8_t (*getDescriptor)(int8_t t);
int8_t numEndpoints;
u8 endpointType[6];
} PUSBCallbacks;
@ -40,11 +40,11 @@ typedef struct
u8 firstEndpoint;
} PUSBReturn;
int PUSB_AddFunction(PUSBCallbacks *cb, u8 *interface);
int8_t PUSB_AddFunction(PUSBCallbacks *cb, u8 *interface);
int PUSB_GetInterface(u8* interfaceNum);
int8_t PUSB_GetInterface(u8* interfaceNum);
int PUSB_GetDescriptor(int t);
int8_t PUSB_GetDescriptor(int8_t t);
bool PUSB_Setup(Setup& setup, u8 i);