1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

Merge pull request #4693 from philmanofsky/master

allow 3rd party boards that depend on sam core to use their own USB vid/pid and manufacturer/product strings
This commit is contained in:
Sandeep Mistry 2016-03-15 09:28:12 -04:00
commit 6aeb80b9de
3 changed files with 13 additions and 18 deletions

View File

@ -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

View File

@ -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"

View File

@ -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