Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf4ba11f

Browse files
committed
Move USB APIs out of arduino namespace
1 parent8f2672e commitf4ba11f

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

‎api/PluggableUSB.h‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626

2727
namespacearduino {
2828

29-
// core need to define
30-
void*epBuffer(unsignedint n);// -> returns a poointer to the Nth element of the EP buffer structure
31-
3229
classPluggableUSBModule {
3330
public:
3431
PluggableUSBModule(uint8_t numEps,uint8_t numIfs,unsignedint *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(unsignedint 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

‎api/USBAPI.h‎

Lines changed: 3 additions & 1 deletion
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
intUSB_SendControl(uint8_t flags,constvoid* d,int len);
@@ -58,5 +61,4 @@ int USB_Recv(uint8_t ep, void* data, int len);// non-blocking
5861
intUSB_Recv(uint8_t ep);// non-blocking
5962
voidUSB_Flush(uint8_t ep);
6063

61-
}
6264
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp