Browse Source

Add bcdDevice info to help teensy_ports identify models

main
PaulStoffregen 6 years ago
parent
commit
6a30e80658
5 changed files with 39 additions and 0 deletions
  1. +15
    -0
      teensy3/usb_desc.c
  2. +6
    -0
      usb_hid/usb.c
  3. +6
    -0
      usb_midi/usb.c
  4. +6
    -0
      usb_serial/usb.c
  5. +6
    -0
      usb_serial_hid/usb.c

+ 15
- 0
teensy3/usb_desc.c View File

@@ -90,7 +90,22 @@ static uint8_t device_descriptor[] = {
#ifdef BCD_DEVICE
LSB(BCD_DEVICE), MSB(BCD_DEVICE), // bcdDevice
#else
// For USB types that don't explicitly define BCD_DEVICE,
// use the minor version number to help teensy_ports
// identify which Teensy model is used.
#if defined(__MKL26Z64__)
0x73, 0x02,
#elif defined(__MK20DX128__)
0x74, 0x02,
#elif defined(__MK20DX256__)
0x75, 0x02,
#elif defined(__MK64FX512__)
0x76, 0x02,
#elif defined(__MK66FX1M0__)
0x77, 0x02,
#else
0x00, 0x02,
#endif
#endif
1, // iManufacturer
2, // iProduct

+ 6
- 0
usb_hid/usb.c View File

@@ -66,7 +66,13 @@ static const uint8_t PROGMEM device_descriptor[] = {
ENDPOINT0_SIZE, // bMaxPacketSize0
LSB(VENDOR_ID), MSB(VENDOR_ID), // idVendor
LSB(PRODUCT_ID), MSB(PRODUCT_ID), // idProduct
#if defined(__AVR_ATmega32U4__)
0x71, 0x02,
#elif defined(__AVR_AT90USB1286__)
0x72, 0x02,
#else
0x05, 0x01, // bcdDevice
#endif
0, // iManufacturer
1, // iProduct
0, // iSerialNumber

+ 6
- 0
usb_midi/usb.c View File

@@ -64,7 +64,13 @@ static const uint8_t PROGMEM device_descriptor[] = {
ENDPOINT0_SIZE, // bMaxPacketSize0
LSB(VENDOR_ID), MSB(VENDOR_ID), // idVendor
LSB(PRODUCT_ID), MSB(PRODUCT_ID), // idProduct
#if defined(__AVR_ATmega32U4__)
0x71, 0x02,
#elif defined(__AVR_AT90USB1286__)
0x72, 0x02,
#else
0x00, 0x01, // bcdDevice
#endif
0, // iManufacturer
1, // iProduct
0, // iSerialNumber

+ 6
- 0
usb_serial/usb.c View File

@@ -63,7 +63,13 @@ static const uint8_t PROGMEM device_descriptor[] = {
ENDPOINT0_SIZE, // bMaxPacketSize0
LSB(VENDOR_ID), MSB(VENDOR_ID), // idVendor
LSB(PRODUCT_ID), MSB(PRODUCT_ID), // idProduct
#if defined(__AVR_ATmega32U4__)
0x71, 0x02,
#elif defined(__AVR_AT90USB1286__)
0x72, 0x02,
#else
0x00, 0x01, // bcdDevice
#endif
1, // iManufacturer
2, // iProduct
3, // iSerialNumber

+ 6
- 0
usb_serial_hid/usb.c View File

@@ -65,7 +65,13 @@ static const uint8_t PROGMEM device_descriptor[] = {
ENDPOINT0_SIZE, // bMaxPacketSize0
LSB(VENDOR_ID), MSB(VENDOR_ID), // idVendor
LSB(PRODUCT_ID), MSB(PRODUCT_ID), // idProduct
#if defined(__AVR_ATmega32U4__)
0x71, 0x02,
#elif defined(__AVR_AT90USB1286__)
0x72, 0x02,
#else
0x02, 0x01, // bcdDevice
#endif
1, // iManufacturer
2, // iProduct
3, // iSerialNumber

Loading…
Cancel
Save