[PUSB] replaced u8 with uint8_t

This commit is contained in:
Cristian Maglie 2015-09-30 14:51:11 +02:00
parent 34a75d9416
commit 7fee0f0a75
3 changed files with 14 additions and 14 deletions

View File

@ -25,21 +25,21 @@
#define MAX_MODULES 6 #define MAX_MODULES 6
static u8 lastIf = CDC_ACM_INTERFACE + CDC_INTERFACE_COUNT; static uint8_t lastIf = CDC_ACM_INTERFACE + CDC_INTERFACE_COUNT;
static u8 lastEp = CDC_FIRST_ENDPOINT + CDC_ENPOINT_COUNT; static uint8_t lastEp = CDC_FIRST_ENDPOINT + CDC_ENPOINT_COUNT;
extern u8 _initEndpoints[]; extern uint8_t _initEndpoints[];
//PUSBCallbacks cbs[MAX_MODULES]; //PUSBCallbacks cbs[MAX_MODULES];
static u8 modules_count = 0; static uint8_t modules_count = 0;
static PUSBListNode* rootNode = NULL; static PUSBListNode* rootNode = NULL;
int PluggableUSB_::getInterface(u8* interfaceNum) int PluggableUSB_::getInterface(uint8_t* interfaceNum)
{ {
int ret = 0; int ret = 0;
PUSBListNode* node = rootNode; PUSBListNode* node = rootNode;
for (u8 i=0; i<modules_count; i++) { for (uint8_t i=0; i<modules_count; i++) {
ret = node->getInterface(interfaceNum); ret = node->getInterface(interfaceNum);
node = node->next; node = node->next;
} }
@ -50,18 +50,18 @@ int PluggableUSB_::getDescriptor(int8_t t)
{ {
int ret = 0; int ret = 0;
PUSBListNode* node = rootNode; PUSBListNode* node = rootNode;
for (u8 i=0; i<modules_count && ret == 0; i++) { for (uint8_t i=0; i<modules_count && ret == 0; i++) {
ret = node->getDescriptor(t); ret = node->getDescriptor(t);
node = node->next; node = node->next;
} }
return ret; return ret;
} }
bool PluggableUSB_::setup(USBSetup& setup, u8 j) bool PluggableUSB_::setup(USBSetup& setup, uint8_t j)
{ {
bool ret = false; bool ret = false;
PUSBListNode* node = rootNode; PUSBListNode* node = rootNode;
for (u8 i=0; i<modules_count && ret == false; i++) { for (uint8_t i=0; i<modules_count && ret == false; i++) {
ret = node->setup(setup, j); ret = node->setup(setup, j);
node = node->next; node = node->next;
} }

View File

@ -28,8 +28,8 @@
class PUSBListNode { class PUSBListNode {
public: public:
PUSBListNode() { } PUSBListNode() { }
bool (*setup)(USBSetup& setup, u8 i); bool (*setup)(USBSetup& setup, uint8_t i);
int (*getInterface)(u8* interfaceNum); int (*getInterface)(uint8_t* interfaceNum);
int (*getDescriptor)(int8_t t); int (*getDescriptor)(int8_t t);
int8_t numEndpoints; int8_t numEndpoints;
int8_t numInterfaces; int8_t numInterfaces;
@ -51,9 +51,9 @@ public:
class PluggableUSB_ { class PluggableUSB_ {
public: public:
static bool plug(PUSBListNode *node); static bool plug(PUSBListNode *node);
static int getInterface(u8* interfaceNum); static int getInterface(uint8_t* interfaceNum);
static int getDescriptor(int8_t t); static int getDescriptor(int8_t t);
static bool setup(USBSetup& setup, u8 i); static bool setup(USBSetup& setup, uint8_t i);
}; };
extern PluggableUSB_ PluggableUSB; extern PluggableUSB_ PluggableUSB;

View File

@ -83,7 +83,7 @@ void HID_::AppendDescriptor(HIDDescriptorListNode *node)
sizeof_hidReportDescriptor += (uint16_t)node->length; sizeof_hidReportDescriptor += (uint16_t)node->length;
} }
void HID_::SendReport(u8 id, const void* data, int len) void HID_::SendReport(uint8_t id, const void* data, int len)
{ {
USB_Send(HID.endpoint(), &id, 1); USB_Send(HID.endpoint(), &id, 1);
USB_Send(HID.endpoint() | TRANSFER_RELEASE,data,len); USB_Send(HID.endpoint() | TRANSFER_RELEASE,data,len);