File tree 4 files changed +16
-14
lines changed 4 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ static u8 modules_count = 0;
35
35
36
36
static PUSBListNode* rootNode = NULL ;
37
37
38
- int PUSB_GetInterface (u8* interfaceNum)
38
+ int PluggableUSB_::getInterface (u8* interfaceNum)
39
39
{
40
40
int ret = 0 ;
41
41
PUSBListNode* node = rootNode;
@@ -46,7 +46,7 @@ int PUSB_GetInterface(u8* interfaceNum)
46
46
return ret;
47
47
}
48
48
49
- int PUSB_GetDescriptor (int8_t t)
49
+ int PluggableUSB_::getDescriptor (int8_t t)
50
50
{
51
51
int ret = 0 ;
52
52
PUSBListNode* node = rootNode;
@@ -57,7 +57,7 @@ int PUSB_GetDescriptor(int8_t t)
57
57
return ret;
58
58
}
59
59
60
- bool PUSB_Setup (USBSetup& setup, u8 j)
60
+ bool PluggableUSB_::setup (USBSetup& setup, u8 j)
61
61
{
62
62
bool ret = false ;
63
63
PUSBListNode* node = rootNode;
@@ -68,7 +68,7 @@ bool PUSB_Setup(USBSetup& setup, u8 j)
68
68
return ret;
69
69
}
70
70
71
- int8_t PUSB_AddFunction (PUSBListNode *node, u8* interface)
71
+ int8_t PluggableUSB_::addFunction (PUSBListNode *node, u8* interface)
72
72
{
73
73
if (modules_count >= MAX_MODULES) {
74
74
return 0 ;
Original file line number Diff line number Diff line change @@ -39,13 +39,15 @@ class PUSBListNode {
39
39
PUSBListNode *next = NULL ;
40
40
};
41
41
42
- int8_t PUSB_AddFunction (PUSBListNode *node, u8 *interface);
43
-
44
- int PUSB_GetInterface (u8* interfaceNum);
45
-
46
- int PUSB_GetDescriptor (int8_t t);
42
+ class PluggableUSB_ {
43
+ public:
44
+ static int8_t addFunction (PUSBListNode *node, u8 *interface);
45
+ static int getInterface (u8* interfaceNum);
46
+ static int getDescriptor (int8_t t);
47
+ static bool setup (USBSetup& setup, u8 i);
48
+ };
47
49
48
- bool PUSB_Setup (USBSetup& setup, u8 i) ;
50
+ extern PluggableUSB_ PluggableUSB ;
49
51
50
52
#endif
51
53
Original file line number Diff line number Diff line change @@ -367,7 +367,7 @@ bool ClassInterfaceRequest(USBSetup& setup)
367
367
return CDC_Setup (setup);
368
368
369
369
#ifdef PLUGGABLE_USB_ENABLED
370
- return PUSB_Setup (setup, i);
370
+ return PluggableUSB. setup (setup, i);
371
371
#endif
372
372
return false ;
373
373
}
@@ -445,7 +445,7 @@ static u8 SendInterfaces()
445
445
CDC_GetInterface (&interfaces);
446
446
447
447
#ifdef PLUGGABLE_USB_ENABLED
448
- PUSB_GetInterface (&interfaces);
448
+ PluggableUSB. getInterface (&interfaces);
449
449
#endif
450
450
451
451
return interfaces;
@@ -481,7 +481,7 @@ bool SendDescriptor(USBSetup& setup)
481
481
482
482
InitControl (setup.wLength );
483
483
#ifdef PLUGGABLE_USB_ENABLED
484
- ret = PUSB_GetDescriptor (t);
484
+ ret = PluggableUSB. getDescriptor (t);
485
485
if (ret != 0 ) {
486
486
return (ret > 0 ? true : false );
487
487
}
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ HID_::HID_(void)
143
143
node.numInterfaces = 1 ,
144
144
node.endpointType = endpointType,
145
145
146
- HID_ENDPOINT_INT = PUSB_AddFunction (&node, &HID_INTERFACE);
146
+ HID_ENDPOINT_INT = PluggableUSB. addFunction (&node, &HID_INTERFACE);
147
147
}
148
148
149
149
int HID_::begin (void )
You can’t perform that action at this time.
0 commit comments