Skip to content

Commit e688a6b

Browse files
committed
Move USB APIs out of arduino namespace
1 parent f59b730 commit e688a6b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Diff for: api/PluggableUSB.h

+5-6
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626

2727
namespace arduino {
2828

29-
// core need to define
30-
void* epBuffer(unsigned int n); // -> returns a poointer to the Nth element of the EP buffer structure
31-
3229
class PluggableUSBModule {
3330
public:
3431
PluggableUSBModule(uint8_t numEps, uint8_t numIfs, unsigned int *epType) :
@@ -68,12 +65,14 @@ class PluggableUSB_ {
6865
PluggableUSBModule* rootNode;
6966
uint8_t totalEP;
7067
};
68+
}
69+
70+
// core need to define
71+
void* epBuffer(unsigned int n); // -> returns a pointer to the Nth element of the EP buffer structure
7172

7273
// Replacement for global singleton.
7374
// This function prevents static-initialization-order-fiasco
7475
// https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use
75-
PluggableUSB_& PluggableUSB();
76-
77-
}
76+
arduino::PluggableUSB_& PluggableUSB();
7877

7978
#endif

Diff for: api/USBAPI.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ typedef struct __attribute__((packed))
4444
uint16_t wLength;
4545
} USBSetup;
4646

47+
}
48+
4749
//================================================================================
50+
// USB APIs (C scope)
4851
//================================================================================
4952

5053
int USB_SendControl(uint8_t flags, const void* d, int len);
@@ -58,5 +61,4 @@ int USB_Recv(uint8_t ep, void* data, int len); // non-blocking
5861
int USB_Recv(uint8_t ep); // non-blocking
5962
void USB_Flush(uint8_t ep);
6063

61-
}
6264
#endif

0 commit comments

Comments
 (0)