USB_CFG_DESCR_PROPS_STRING_PRODUCT dynamic?

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

USB_CFG_DESCR_PROPS_STRING_PRODUCT dynamic?

Post by ulao » Tue Jun 27, 2017 3:18 pm

how can I make this dynamic. I need to set my product string via eeprom for a project I'm using.



tried
#define USB_CFG_DESCR_PROPS_STRING_PRODUCT (USB_PROP_IS_RAM | USB_PROP_LENGTH(12))
and
#define USB_CFG_DESCR_PROPS_STRING_PRODUCT USB_PROP_IS_DYNAMIC | USB_PROP_IS_RAM)

both allow the code to work.
i.e. rename first letter to x
usbDescriptorStringDevice[0] = 'x';

but nether work. I get some basic windows name for the device. The generic name for the gamepad class I think ( 8 axis, 24 button ..)

horo
Rank 2
Rank 2
Posts: 63
Joined: Tue Mar 04, 2008 2:26 pm
Location: Berlin & Lindau, Germany

Re: USB_CFG_DESCR_PROPS_STRING_PRODUCT dynamic?

Post by horo » Wed Jul 05, 2017 12:14 pm

Hi ulao,

I did this in my MIDI project to allow a dynamic naming via an e.g. address switch to have more than one devices connected and recognized. Please have a look at the source code at my bitbucket. Unfortunately I have not time to deep dive into my code, so please try it at your own - but as a long time V-USB-user you should have no problem.

Ciao, Martin

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: USB_CFG_DESCR_PROPS_STRING_PRODUCT dynamic?

Post by ulao » Fri Jul 14, 2017 5:54 pm

It's ok, I solve my issue last night. My main issue was USB_PROP_LENGTH(12) needed USB_PROP_LENGTH(24). Thx for the link, I'll check it out and see if we used the same approach.

Post Reply