@Paul, can we talk about user-setable USB IDs?
At least for non-Arduino IDEs it is possible to set defines, so it would be possible to use something like that:
in usb_desc.h, at the beginning of the file and remove all later #defines.
It would (at least) make development much easier when using multiple Teensys on one computer. I use one as a USB sound card, and it is irritating when Teensyduino tries to program the board (best would be "invisible" to TD unless I press the button - Usually, I don't want to program it).
I don't think I'm the only user who experiences this issue.
The above change has the intended nice side effect of allowing users to easily set their own IDs without having to patch TD every time.
It could be extended with PRODUCT_NAME
Edit:
Example: With Platformio you could just add it to the project (platformio) ini:
The MANUFACTURER_NAME_LEN is not needed.
It can be caluclated during compile-time (optional addition to usb_desc.h) :
Same for PRODUCT_NAME_LEN.
At least for non-Arduino IDEs it is possible to set defines, so it would be possible to use something like that:
Code:
#if !defined(VENDOR_ID) && !defined(MANUFACTURER_NAME) && !defined(MANUFACTURER_NAME_LEN)
#define VENDOR_ID 0x16C0
#define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
#define MANUFACTURER_NAME_LEN 11
#endif
in usb_desc.h, at the beginning of the file and remove all later #defines.
It would (at least) make development much easier when using multiple Teensys on one computer. I use one as a USB sound card, and it is irritating when Teensyduino tries to program the board (best would be "invisible" to TD unless I press the button - Usually, I don't want to program it).
I don't think I'm the only user who experiences this issue.
The above change has the intended nice side effect of allowing users to easily set their own IDs without having to patch TD every time.
It could be extended with PRODUCT_NAME
Edit:
Example: With Platformio you could just add it to the project (platformio) ini:
Code:
[COLOR=#d4d4d4][FONT=Consolas][COLOR=#569cd6]build_flags[/COLOR][COLOR=#d4d4d4] = [/COLOR]
[COLOR=#d4d4d4] -D USB_MIDI_AUDIO_SERIAL[/COLOR]
[COLOR=#d4d4d4] -D [/COLOR][COLOR=#569cd6]VENDOR_ID[/COLOR][COLOR=#d4d4d4]=0xffff[/COLOR]
[COLOR=#d4d4d4] -D [/COLOR][COLOR=#569cd6]MANUFACTURER_NAME[/COLOR][COLOR=#d4d4d4]=[/COLOR][COLOR=#ce9178]"{'F','r','a','n','k','y','d','u','i','n','o'}"[/COLOR]
[COLOR=#d4d4d4] -D [/COLOR][COLOR=#569cd6]MANUFACTURER_NAME_LEN[/COLOR][COLOR=#d4d4d4]=11[/COLOR]
[/FONT][/COLOR]
The MANUFACTURER_NAME_LEN is not needed.
It can be caluclated during compile-time (optional addition to usb_desc.h) :
Code:
#if !defined(VENDOR_ID) && !defined(MANUFACTURER_NAME)
#define VENDOR_ID 0x16C0
#define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
#endif
[B]#define MANUFACTURER_NAME_LEN sizeof((char[])MANUFACTURER_NAME)[/B]
Same for PRODUCT_NAME_LEN.
Last edited: