summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-09-06 18:26:17 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-09-06 18:26:17 +0000
commit336cec2e1f698a6b60d67f25235bbcf356b768c1 (patch)
tree3dd14cea041d97b877a592a61614d87c0acfa910 /firmware
parentb69df427762fcc3219a8fc83176d8f5996a0b499 (diff)
downloadrockbox-336cec2e1f698a6b60d67f25235bbcf356b768c1.tar.gz
rockbox-336cec2e1f698a6b60d67f25235bbcf356b768c1.tar.bz2
rockbox-336cec2e1f698a6b60d67f25235bbcf356b768c1.zip
Fix set_serial_descriptor() for targets with as3543
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28013 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/as3514.h6
-rw-r--r--firmware/usbstack/usb_core.c8
2 files changed, 10 insertions, 4 deletions
diff --git a/firmware/export/as3514.h b/firmware/export/as3514.h
index de975ce3c6..dfe0f8017f 100644
--- a/firmware/export/as3514.h
+++ b/firmware/export/as3514.h
@@ -118,7 +118,13 @@ extern void audiohw_set_sampr_dividers(int fsel);
#define AS3514_ADC_0 0x2e
#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_LEN 16
+#endif
/*different volume ranges for different AMS chips*/
#if CONFIG_CPU == AS3525v2
diff --git a/firmware/usbstack/usb_core.c b/firmware/usbstack/usb_core.c
index d6c8c6e5cc..4988800dad 100644
--- a/firmware/usbstack/usb_core.c
+++ b/firmware/usbstack/usb_core.c
@@ -307,17 +307,17 @@ static void set_serial_descriptor(void)
#elif defined(HAVE_AS3514)
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 */
short* p = &usb_string_iSerial.wString[1];
int i;
- ascodec_readbytes(AS3514_UID_0, 0x10, serial);
- for(i = 0; i < 16; i++) {
+ ascodec_readbytes(AS3514_UID_0, AS3514_UID_LEN, serial);
+ for(i = 0; i < AS3514_UID_LEN; i++) {
*p++ = hex[(serial[i] >> 4) & 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)
/* If we don't know the device serial number, use the one