USB: Do not compile USB on devices that does not have it

This commit is contained in:
Daniel Fekete 2017-05-15 20:17:49 +02:00
parent b6c8b8bc18
commit 623e0c5f4a
2 changed files with 6 additions and 0 deletions

View File

@ -47,7 +47,9 @@ int main(void)
initVariant();
#if defined(USB_BASE) || defined(USB_OTG_DEVICE_BASE)
USBDeviceFS.beginMenuSelection();
#endif
setup();

View File

@ -22,6 +22,8 @@
#include "Arduino.h"
#if defined(USB_BASE) || defined(USB_OTG_DEVICE_BASE)
#include "USBDevice.h"
#include "usbd_core.h"
#include "usbd_desc.h"
@ -123,3 +125,5 @@ extern "C" void USBSerial_Rx_Handler(uint8_t *data, uint16_t len){
USBD_HandleTypeDef hUsbDeviceFS;
USBDeviceClass USBDeviceFS;
#endif