From caaf3c0b97b59117cacd221ed4557b2fd351b5b3 Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Sun, 30 Nov 2008 15:43:15 +0000 Subject: [PATCH] Move tcc77x/usb-tcc77x.c to usb-tcc.c as it is more general than just tcc77x (even usb-tcc is too specific, but I don't know anything better) Add #if0ed USB defines to config-cowond2.h, so experimenting with USB is easy Add dummy set_serial_descriptor() implementation to usb_core.c. This one doesn't generate a unique serial, so it must never be used for non-testing purposes. When usaed, a compiler warning will be generated git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19273 a1c6a512-1295-4272-9138-f99709370657 --- firmware/SOURCES | 10 +++++----- firmware/export/config-cowond2.h | 8 ++++++++ firmware/export/{usb-tcc7xx.h => usb-tcc.h} | 0 .../target/arm/{tcc77x/usb-tcc77x.c => usb-tcc.c} | 2 +- firmware/usbstack/usb_core.c | 12 +++++++++++- 5 files changed, 25 insertions(+), 7 deletions(-) rename firmware/export/{usb-tcc7xx.h => usb-tcc.h} (100%) rename firmware/target/arm/{tcc77x/usb-tcc77x.c => usb-tcc.c} (99%) diff --git a/firmware/SOURCES b/firmware/SOURCES index 9b576d435a..d0862ba37b 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -1013,7 +1013,7 @@ target/arm/tcc77x/kernel-tcc77x.c target/arm/tcc77x/powermgmt-tcc77x.c target/arm/tcc77x/system-tcc77x.c target/arm/tcc77x/timer-tcc77x.c -target/arm/tcc77x/usb-tcc77x.c +target/arm/usb-tcc.c target/arm/tcc77x/logikdax/button-logikdax.c target/arm/tcc77x/logikdax/power-logikdax.c #ifndef BOOTLOADER @@ -1034,7 +1034,7 @@ target/arm/tcc77x/kernel-tcc77x.c target/arm/tcc77x/powermgmt-tcc77x.c target/arm/tcc77x/system-tcc77x.c target/arm/tcc77x/timer-tcc77x.c -target/arm/tcc77x/usb-tcc77x.c +target/arm/usb-tcc.c target/arm/tcc77x/m200/button-m200.c target/arm/tcc77x/m200/power-m200.c #ifndef BOOTLOADER @@ -1055,7 +1055,7 @@ target/arm/tcc77x/c100/lcd-S6B33B2.c target/arm/tcc77x/powermgmt-tcc77x.c target/arm/tcc77x/system-tcc77x.c target/arm/tcc77x/timer-tcc77x.c -target/arm/tcc77x/usb-tcc77x.c +target/arm/usb-tcc.c target/arm/tcc77x/c100/button-c100.c target/arm/tcc77x/c100/power-c100.c #ifndef BOOTLOADER @@ -1110,7 +1110,7 @@ target/arm/tcc77x/kernel-tcc77x.c target/arm/tcc77x/timer-tcc77x.c target/arm/tcc77x/adc-tcc77x.c target/arm/tcc77x/powermgmt-tcc77x.c -target/arm/tcc77x/usb-tcc77x.c +target/arm/usb-tcc.c target/arm/tcc77x/iaudio7/lcd-iaudio7.c target/arm/tcc77x/iaudio7/power-iaudio7.c target/arm/tcc77x/iaudio7/button-iaudio7.c @@ -1135,8 +1135,8 @@ target/arm/tcc780x/cowond2/button-cowond2.c target/arm/tcc780x/cowond2/lcd-cowond2.c target/arm/tcc780x/cowond2/power-cowond2.c target/arm/tcc780x/cowond2/powermgmt-cowond2.c -target/arm/tcc780x/cowond2/usb-cowond2.c target/arm/tcc780x/cowond2/backlight-cowond2.c +target/arm/usb-tcc.c #ifndef BOOTLOADER target/arm/tcc780x/kernel-tcc780x.c target/arm/tcc780x/timer-tcc780x.c diff --git a/firmware/export/config-cowond2.h b/firmware/export/config-cowond2.h index c6e4555f18..edeb834ef7 100644 --- a/firmware/export/config-cowond2.h +++ b/firmware/export/config-cowond2.h @@ -8,6 +8,14 @@ #define MODEL_NAME "Cowon D2" +#if 0 +#define HAVE_USBSTACK +#define USE_ROCKBOX_USB +#define USB_VENDOR_ID 0x0e21 +#define USB_PRODUCT_ID 0x0800 +#endif + + /* Produce a dual-boot bootloader.bin for mktccboot */ #define TCCBOOT diff --git a/firmware/export/usb-tcc7xx.h b/firmware/export/usb-tcc.h similarity index 100% rename from firmware/export/usb-tcc7xx.h rename to firmware/export/usb-tcc.h diff --git a/firmware/target/arm/tcc77x/usb-tcc77x.c b/firmware/target/arm/usb-tcc.c similarity index 99% rename from firmware/target/arm/tcc77x/usb-tcc77x.c rename to firmware/target/arm/usb-tcc.c index f5bb7c9ff2..345f6bed78 100644 --- a/firmware/target/arm/tcc77x/usb-tcc77x.c +++ b/firmware/target/arm/usb-tcc.c @@ -22,7 +22,7 @@ #include "config.h" #include "usb.h" -#include "usb-tcc7xx.h" +#include "usb-tcc.h" #include "cpu.h" #include "system.h" diff --git a/firmware/usbstack/usb_core.c b/firmware/usbstack/usb_core.c index 6003c8d197..5f22d87c5e 100644 --- a/firmware/usbstack/usb_core.c +++ b/firmware/usbstack/usb_core.c @@ -314,7 +314,17 @@ static void set_serial_descriptor(void) usb_string_iSerial.bLength=68; } #else -#error No set_serial_descriptor() implementation for this target +#warning No proper set_serial_descriptor() implementation for this target +static void set_serial_descriptor(void) +{ + short* p = &usb_string_iSerial.wString[1]; + int i; + for (i = 0; i < 16; i++) { + *p++ = hex[(2*i)&0xF]; + *p++ = hex[(2*i+1)&0xF]; + } + usb_string_iSerial.bLength=68; +} #endif void usb_core_init(void)