forked from len0rd/rockbox
Fix set_serial_descriptor() for targets with as3543
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28013 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b69df42776
commit
336cec2e1f
2 changed files with 10 additions and 4 deletions
|
@ -118,7 +118,13 @@ extern void audiohw_set_sampr_dividers(int fsel);
|
||||||
#define AS3514_ADC_0 0x2e
|
#define AS3514_ADC_0 0x2e
|
||||||
#define AS3514_ADC_1 0x2f
|
#define AS3514_ADC_1 0x2f
|
||||||
|
|
||||||
|
#ifdef HAVE_AS3543
|
||||||
|
#define AS3514_UID_0 0x38
|
||||||
|
#define AS3514_UID_LEN 8
|
||||||
|
#else
|
||||||
#define AS3514_UID_0 0x30
|
#define AS3514_UID_0 0x30
|
||||||
|
#define AS3514_UID_LEN 16
|
||||||
|
#endif
|
||||||
|
|
||||||
/*different volume ranges for different AMS chips*/
|
/*different volume ranges for different AMS chips*/
|
||||||
#if CONFIG_CPU == AS3525v2
|
#if CONFIG_CPU == AS3525v2
|
||||||
|
|
|
@ -307,17 +307,17 @@ static void set_serial_descriptor(void)
|
||||||
#elif defined(HAVE_AS3514)
|
#elif defined(HAVE_AS3514)
|
||||||
static void set_serial_descriptor(void)
|
static void set_serial_descriptor(void)
|
||||||
{
|
{
|
||||||
unsigned char serial[16];
|
unsigned char serial[AS3514_UID_LEN];
|
||||||
/* Align 32 digits right in the 40-digit serial number */
|
/* Align 32 digits right in the 40-digit serial number */
|
||||||
short* p = &usb_string_iSerial.wString[1];
|
short* p = &usb_string_iSerial.wString[1];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
ascodec_readbytes(AS3514_UID_0, 0x10, serial);
|
ascodec_readbytes(AS3514_UID_0, AS3514_UID_LEN, serial);
|
||||||
for(i = 0; i < 16; i++) {
|
for(i = 0; i < AS3514_UID_LEN; i++) {
|
||||||
*p++ = hex[(serial[i] >> 4) & 0xF];
|
*p++ = hex[(serial[i] >> 4) & 0xF];
|
||||||
*p++ = hex[(serial[i] >> 0) & 0xF];
|
*p++ = hex[(serial[i] >> 0) & 0xF];
|
||||||
}
|
}
|
||||||
usb_string_iSerial.bLength = 68;
|
usb_string_iSerial.bLength = 36 + (2 * AS3514_UID_LEN);
|
||||||
}
|
}
|
||||||
#elif (CONFIG_STORAGE & STORAGE_ATA)
|
#elif (CONFIG_STORAGE & STORAGE_ATA)
|
||||||
/* If we don't know the device serial number, use the one
|
/* If we don't know the device serial number, use the one
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue