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

#ifdef BCD_DEVICE #ifdef BCD_DEVICE
LSB(BCD_DEVICE), MSB(BCD_DEVICE), // bcdDevice LSB(BCD_DEVICE), MSB(BCD_DEVICE), // bcdDevice
#else #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, 0x00, 0x02,
#endif
#endif #endif
1, // iManufacturer 1, // iManufacturer
2, // iProduct 2, // iProduct

+ 6
- 0
usb_hid/usb.c View File

ENDPOINT0_SIZE, // bMaxPacketSize0 ENDPOINT0_SIZE, // bMaxPacketSize0
LSB(VENDOR_ID), MSB(VENDOR_ID), // idVendor LSB(VENDOR_ID), MSB(VENDOR_ID), // idVendor
LSB(PRODUCT_ID), MSB(PRODUCT_ID), // idProduct LSB(PRODUCT_ID), MSB(PRODUCT_ID), // idProduct
#if defined(__AVR_ATmega32U4__)
0x71, 0x02,
#elif defined(__AVR_AT90USB1286__)
0x72, 0x02,
#else
0x05, 0x01, // bcdDevice 0x05, 0x01, // bcdDevice
#endif
0, // iManufacturer 0, // iManufacturer
1, // iProduct 1, // iProduct
0, // iSerialNumber 0, // iSerialNumber

+ 6
- 0
usb_midi/usb.c View File

ENDPOINT0_SIZE, // bMaxPacketSize0 ENDPOINT0_SIZE, // bMaxPacketSize0
LSB(VENDOR_ID), MSB(VENDOR_ID), // idVendor LSB(VENDOR_ID), MSB(VENDOR_ID), // idVendor
LSB(PRODUCT_ID), MSB(PRODUCT_ID), // idProduct LSB(PRODUCT_ID), MSB(PRODUCT_ID), // idProduct
#if defined(__AVR_ATmega32U4__)
0x71, 0x02,
#elif defined(__AVR_AT90USB1286__)
0x72, 0x02,
#else
0x00, 0x01, // bcdDevice 0x00, 0x01, // bcdDevice
#endif
0, // iManufacturer 0, // iManufacturer
1, // iProduct 1, // iProduct
0, // iSerialNumber 0, // iSerialNumber

+ 6
- 0
usb_serial/usb.c View File

ENDPOINT0_SIZE, // bMaxPacketSize0 ENDPOINT0_SIZE, // bMaxPacketSize0
LSB(VENDOR_ID), MSB(VENDOR_ID), // idVendor LSB(VENDOR_ID), MSB(VENDOR_ID), // idVendor
LSB(PRODUCT_ID), MSB(PRODUCT_ID), // idProduct LSB(PRODUCT_ID), MSB(PRODUCT_ID), // idProduct
#if defined(__AVR_ATmega32U4__)
0x71, 0x02,
#elif defined(__AVR_AT90USB1286__)
0x72, 0x02,
#else
0x00, 0x01, // bcdDevice 0x00, 0x01, // bcdDevice
#endif
1, // iManufacturer 1, // iManufacturer
2, // iProduct 2, // iProduct
3, // iSerialNumber 3, // iSerialNumber

+ 6
- 0
usb_serial_hid/usb.c View File

ENDPOINT0_SIZE, // bMaxPacketSize0 ENDPOINT0_SIZE, // bMaxPacketSize0
LSB(VENDOR_ID), MSB(VENDOR_ID), // idVendor LSB(VENDOR_ID), MSB(VENDOR_ID), // idVendor
LSB(PRODUCT_ID), MSB(PRODUCT_ID), // idProduct LSB(PRODUCT_ID), MSB(PRODUCT_ID), // idProduct
#if defined(__AVR_ATmega32U4__)
0x71, 0x02,
#elif defined(__AVR_AT90USB1286__)
0x72, 0x02,
#else
0x02, 0x01, // bcdDevice 0x02, 0x01, // bcdDevice
#endif
1, // iManufacturer 1, // iManufacturer
2, // iProduct 2, // iProduct
3, // iSerialNumber 3, // iSerialNumber

Loading…
Cancel
Save