Browse Source

Add define guards to allow compiler flags to change product name/serial number

teensy4-core
David Hedin 7 years ago
parent
commit
5c064702ba
6 changed files with 31 additions and 0 deletions
  1. +4
    -0
      usb_disk/usb_private.h
  2. +3
    -0
      usb_hid/usb_private.h
  3. +3
    -0
      usb_midi/usb_private.h
  4. +6
    -0
      usb_rawhid/usb_private.h
  5. +6
    -0
      usb_serial/usb_private.h
  6. +9
    -0
      usb_serial_hid/usb_private.h

+ 4
- 0
usb_disk/usb_private.h View File



#define VENDOR_ID 0x16C0 #define VENDOR_ID 0x16C0
#define PRODUCT_ID 0x0484 #define PRODUCT_ID 0x0484
#ifndef STR_PRODUCT
#define STR_PRODUCT L"Teensy Disk/Keyboard" #define STR_PRODUCT L"Teensy Disk/Keyboard"
#endif
#ifndef STR_SERIAL_NUMBER
#define STR_SERIAL_NUMBER L"123456789ABCDEF0" #define STR_SERIAL_NUMBER L"123456789ABCDEF0"
#endif


// Some operating systems, especially Windows, may cache USB device // Some operating systems, especially Windows, may cache USB device
// info. Changes to the device name may not update on the same // info. Changes to the device name may not update on the same

+ 3
- 0
usb_hid/usb_private.h View File

// computer unless the vendor or product ID numbers change, or the // computer unless the vendor or product ID numbers change, or the
// "bcdDevice" revision code is increased. // "bcdDevice" revision code is increased.


#ifndef STR_PRODUCT
#define STR_PRODUCT L"Teensy Keyboard/Mouse/Joystick" #define STR_PRODUCT L"Teensy Keyboard/Mouse/Joystick"
#endif

#define ENDPOINT0_SIZE 64 #define ENDPOINT0_SIZE 64


#define DEBUG_INTERFACE 2 #define DEBUG_INTERFACE 2

+ 3
- 0
usb_midi/usb_private.h View File

// computer unless the vendor or product ID numbers change, or the // computer unless the vendor or product ID numbers change, or the
// "bcdDevice" revision code is increased. // "bcdDevice" revision code is increased.


#ifndef STR_PRODUCT
#define STR_PRODUCT L"Teensy MIDI" #define STR_PRODUCT L"Teensy MIDI"
#endif

#define ENDPOINT0_SIZE 64 #define ENDPOINT0_SIZE 64


#define DEBUG_INTERFACE 1 #define DEBUG_INTERFACE 1

+ 6
- 0
usb_rawhid/usb_private.h View File

* *
**************************************************************************/ **************************************************************************/


#ifndef STR_PRODUCT
#define STR_PRODUCT L"Teensyduino RawHID Device" #define STR_PRODUCT L"Teensyduino RawHID Device"
#endif
#ifndef STR_RAWHID
#define STR_RAWHID L"Teensyduino RawHID" #define STR_RAWHID L"Teensyduino RawHID"
#endif
#ifndef STR_DEBUG
#define STR_DEBUG L"Emulated Arduino Serial" #define STR_DEBUG L"Emulated Arduino Serial"
#endif
#define ENDPOINT0_SIZE 64 #define ENDPOINT0_SIZE 64


// Some operating systems, especially Windows, may cache USB device // Some operating systems, especially Windows, may cache USB device

+ 6
- 0
usb_serial/usb_private.h View File



// You can change these to give your code its own name. On Windows, // You can change these to give your code its own name. On Windows,
// these are only used before an INF file (driver install) is loaded. // these are only used before an INF file (driver install) is loaded.
#ifndef STR_MANUFACTURER
#define STR_MANUFACTURER L"Teensyduino" #define STR_MANUFACTURER L"Teensyduino"
#endif
#ifndef STR_PRODUCT
#define STR_PRODUCT L"USB Serial" #define STR_PRODUCT L"USB Serial"
#endif


// Some operating systems, especially Windows, may cache USB device // Some operating systems, especially Windows, may cache USB device
// info. Changes to the device name may not update on the same // info. Changes to the device name may not update on the same
// Udev rules (in /etc/udev/rules.d) can define persistent device // Udev rules (in /etc/udev/rules.d) can define persistent device
// names linked to this serial number, as well as permissions, owner // names linked to this serial number, as well as permissions, owner
// and group settings. // and group settings.
#ifndef STR_SERIAL_NUMBER
#define STR_SERIAL_NUMBER L"12345" #define STR_SERIAL_NUMBER L"12345"
#endif


// Mac OS-X and Linux automatically load the correct drivers. On // Mac OS-X and Linux automatically load the correct drivers. On
// Windows, even though the driver is supplied by Microsoft, an // Windows, even though the driver is supplied by Microsoft, an

+ 9
- 0
usb_serial_hid/usb_private.h View File



// You can change these to give your code its own name. On Windows, // You can change these to give your code its own name. On Windows,
// these are only used before an INF file (driver install) is loaded. // these are only used before an INF file (driver install) is loaded.
#ifndef STR_MANUFACTURER
#define STR_MANUFACTURER L"Teensyduino" #define STR_MANUFACTURER L"Teensyduino"
#endif
#ifndef STR_PRODUCT
#define STR_PRODUCT L"Serial+Keyboard+Mouse+Joystick" #define STR_PRODUCT L"Serial+Keyboard+Mouse+Joystick"
#endif
#ifndef STR_SERIAL
#define STR_SERIAL L"Serial" #define STR_SERIAL L"Serial"
#endif


// Some operating systems, especially Windows, may cache USB device // Some operating systems, especially Windows, may cache USB device
// info. Changes to the device name may not update on the same // info. Changes to the device name may not update on the same
// Udev rules (in /etc/udev/rules.d) can define persistent device // Udev rules (in /etc/udev/rules.d) can define persistent device
// names linked to this serial number, as well as permissions, owner // names linked to this serial number, as well as permissions, owner
// and group settings. // and group settings.
#ifndef STR_SERIAL_NUMBER
#define STR_SERIAL_NUMBER L"12345" #define STR_SERIAL_NUMBER L"12345"
#endif


// Mac OS-X and Linux automatically load the correct drivers. On // Mac OS-X and Linux automatically load the correct drivers. On
// Windows, even though the driver is supplied by Microsoft, an // Windows, even though the driver is supplied by Microsoft, an

Loading…
Cancel
Save