diff --git a/hardware/arduino/sam/boards.txt b/hardware/arduino/sam/boards.txt index 249420051..550378612 100644 --- a/hardware/arduino/sam/boards.txt +++ b/hardware/arduino/sam/boards.txt @@ -12,6 +12,7 @@ arduino_due_x_dbg.upload.wait_for_upload_port=false arduino_due_x_dbg.upload.native_usb=false arduino_due_x_dbg.build.mcu=cortex-m3 arduino_due_x_dbg.build.f_cpu=84000000L +arduino_due_x_dbg.build.usb_manufacturer="Arduino LLC" arduino_due_x_dbg.build.usb_product="Arduino Due" arduino_due_x_dbg.build.board=SAM_DUE arduino_due_x_dbg.build.core=arduino @@ -35,6 +36,7 @@ arduino_due_x.upload.wait_for_upload_port=true arduino_due_x.upload.native_usb=true arduino_due_x.build.mcu=cortex-m3 arduino_due_x.build.f_cpu=84000000L +arduino_due_x.build.usb_manufacturer="Arduino LLC" arduino_due_x.build.usb_product="Arduino Due" arduino_due_x.build.board=SAM_DUE arduino_due_x.build.core=arduino diff --git a/hardware/arduino/sam/cores/arduino/Arduino.h b/hardware/arduino/sam/cores/arduino/Arduino.h index 4fae76a2a..015c11562 100644 --- a/hardware/arduino/sam/cores/arduino/Arduino.h +++ b/hardware/arduino/sam/cores/arduino/Arduino.h @@ -209,10 +209,14 @@ extern const PinDescription g_APinDescription[] ; #include "watchdog.h" // USB Device -#define USB_VID 0x2341 // arduino LLC vid -#define USB_PID_LEONARDO 0x0034 -#define USB_PID_MICRO 0x0035 -#define USB_PID_DUE 0x003E +#ifndef USB_VID +#define USB_VID 0x2341 // arduino LLC vid +#endif + +#ifndef USB_PID +#define USB_PID 0x003E // arduino Due pid +#endif + #include "USB/USBDesc.h" #include "USB/USBCore.h" #include "USB/USBAPI.h" diff --git a/hardware/arduino/sam/cores/arduino/USB/USBCore.cpp b/hardware/arduino/sam/cores/arduino/USB/USBCore.cpp index 5cddc4c6b..e7652016d 100644 --- a/hardware/arduino/sam/cores/arduino/USB/USBCore.cpp +++ b/hardware/arduino/sam/cores/arduino/USB/USBCore.cpp @@ -66,27 +66,16 @@ const uint16_t STRING_LANGUAGE[2] = { }; #ifndef USB_PRODUCT -// Use a hardcoded product name if none is provided -#if USB_PID == USB_PID_DUE #define USB_PRODUCT "Arduino Due" -#else -#define USB_PRODUCT "USB IO Board" -#endif #endif const uint8_t STRING_PRODUCT[] = USB_PRODUCT; -#if USB_VID == 0x2341 -# if defined(USB_MANUFACTURER) -# undef USB_MANUFACTURER -# endif -# define USB_MANUFACTURER "Arduino LLC" -#elif !defined(USB_MANUFACTURER) -// Fall through to unknown if no manufacturer name was provided in a macro -# define USB_MANUFACTURER "Unknown" +#ifndef USB_MANUFACTURER +#define USB_MANUFACTURER "Arduino LLC" #endif -const uint8_t STRING_MANUFACTURER[12] = USB_MANUFACTURER; +const uint8_t STRING_MANUFACTURER[] = USB_MANUFACTURER; #ifdef CDC_ENABLED #define DEVICE_CLASS 0x02