Skip to content

Commit 38d5cd8

Browse files
committed
[USB] Generic Device descriptor
Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 956d4b3 commit 38d5cd8

File tree

13 files changed

+346
-1836
lines changed

13 files changed

+346
-1836
lines changed

cores/arduino/board.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ extern "C"{
2121
#include "twi.h"
2222
#include "uart.h"
2323
#ifdef USBCON
24+
#if !defined(USB_BASE) && !defined(USB_OTG_DEVICE_BASE)
25+
#error "This board does not support USB! Select 'None' in the 'Tools->USB interface' menu"
26+
#endif
2427
#include "usb_interface.h"
25-
#endif //USBCON
28+
#endif /* USBCON */
2629

2730
void init( void ) ;
2831
#ifdef __cplusplus

cores/arduino/stm32/usb_interface.h

+3-12
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
******************************************************************************
33
* @file usb_interface.h
44
* @author WI6LABS
5-
* @version V1.0.0
6-
* @date 27-October-2016
75
* @brief Header for usb interface
86
******************************************************************************
97
* @attention
@@ -41,18 +39,11 @@
4139
#ifdef USBCON
4240

4341
/* Includes ------------------------------------------------------------------*/
44-
#if __has_include("usbd_desc.h")
4542
#include "usbd_desc.h"
46-
#else
43+
4744
#ifdef USBD_USE_HID_COMPOSITE
48-
#error "This board does not support (yet?) USB HID! Select 'None' in the 'Tools->USB interface' menu"
49-
#elif defined(USBD_USE_CDC)
50-
#error "This board does not support (yet?) USB CDC! Select 'None' in the 'Tools->USB interface' menu"
51-
#else
52-
#error "This board does not support (yet?) USB! Select 'None' in the 'Tools->USB interface' menu"
53-
#endif
54-
#endif
5545
#include "usbd_hid_composite.h"
46+
#endif
5647

5748
#ifdef __cplusplus
5849
extern "C" {
@@ -71,7 +62,7 @@ void usbd_interface_keyboard_sendReport(uint8_t *report, uint16_t len);
7162
#ifdef __cplusplus
7263
}
7364
#endif
74-
#endif // USBCON
65+
#endif /* USBCON */
7566

7667
#endif /* __USB_INTERFACE_H */
7768

0 commit comments

Comments
 (0)