From 202ee59d5c17cd6ea91ac4ffb39d008a2d95ffe3 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 25 Apr 2019 01:05:13 +0700 Subject: [PATCH] move USB VID & PID to variant.h --- cores/nRF5/main.cpp | 6 ------ variants/feather_nrf52840_express/variant.h | 5 +++++ variants/metro_nrf52840_express/variant.h | 5 +++++ variants/pca10056/variant.h | 5 +++++ 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/cores/nRF5/main.cpp b/cores/nRF5/main.cpp index ff56e514..b363c97f 100644 --- a/cores/nRF5/main.cpp +++ b/cores/nRF5/main.cpp @@ -18,12 +18,6 @@ #include "usb.h" -/* USB VID/PID if not defined, tinyusb to use default value - * Note: different class combination e.g CDC and (CDC + MSC) should have different - * PID since Host OS will "remembered" device driver after the first plug */ -#define USB_VID 0x239A -#define USB_PID 0x8029 - // DEBUG Level 1 #if CFG_DEBUG // weak function to avoid compilation error with diff --git a/variants/feather_nrf52840_express/variant.h b/variants/feather_nrf52840_express/variant.h index f0e1d51b..79a16825 100644 --- a/variants/feather_nrf52840_express/variant.h +++ b/variants/feather_nrf52840_express/variant.h @@ -138,6 +138,11 @@ static const uint8_t SCK = PIN_SPI_SCK ; #define USB_MSC_BLOCK_SIZE 512 #define USB_MSC_BLOCK_COUNT ((2*1024*1024) / USB_MSC_BLOCK_SIZE) +/* Note: different class combination e.g CDC and (CDC + MSC) should have different + * PID since Host OS will "remembered" device driver after the first plug */ +#define USB_VID 0x239A +#define USB_PID 0x8029 + #ifdef __cplusplus } #endif diff --git a/variants/metro_nrf52840_express/variant.h b/variants/metro_nrf52840_express/variant.h index 89bafdb9..3f6629e4 100644 --- a/variants/metro_nrf52840_express/variant.h +++ b/variants/metro_nrf52840_express/variant.h @@ -136,6 +136,11 @@ static const uint8_t SCK = PIN_SPI_SCK ; // If EXTERNAL_FLASH_DEVICES is not defined, all supported devices will be used #define EXTERNAL_FLASH_DEVICES GD25Q16C +/* Note: different class combination e.g CDC and (CDC + MSC) should have different + * PID since Host OS will "remembered" device driver after the first plug */ +#define USB_VID 0x239A +#define USB_PID 0x8029 + #ifdef __cplusplus } #endif diff --git a/variants/pca10056/variant.h b/variants/pca10056/variant.h index 035e2d4f..fe43b72a 100644 --- a/variants/pca10056/variant.h +++ b/variants/pca10056/variant.h @@ -131,6 +131,11 @@ static const uint8_t SCK = PIN_SPI_SCK ; #define USB_MSC_BLOCK_SIZE 512 #define USB_MSC_BLOCK_COUNT ((8*1024*1024) / USB_MSC_BLOCK_SIZE) +/* Note: different class combination e.g CDC and (CDC + MSC) should have different + * PID since Host OS will "remembered" device driver after the first plug */ +#define USB_VID 0x239A +#define USB_PID 0x8029 + #ifdef __cplusplus } #endif