summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-12-04 19:44:03 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-12-04 19:44:03 +0000
commit7ea9e31658da4fce9c4a3e30838b82fda8eda287 (patch)
treed0470a3d41b30dd7d26487be9e29436c0162055a /firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
parentc848d2dd990e69a0a10a3f501f64575efbe25695 (diff)
downloadrockbox-7ea9e31658da4fce9c4a3e30838b82fda8eda287.tar.gz
rockbox-7ea9e31658da4fce9c4a3e30838b82fda8eda287.tar.bz2
rockbox-7ea9e31658da4fce9c4a3e30838b82fda8eda287.zip
Ingenic targets:
* Get audio working (only noise atm) * Clean up some stuff in USB git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19329 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/usb-jz4740.c')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/usb-jz4740.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c b/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
index 1d58cbc14d..16965159f6 100644
--- a/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
@@ -28,8 +28,11 @@
#include "jz4740.h"
#include "thread.h"
-//#define DEBUGF printf
+#if 1
+#define DEBUGF printf
+#else
#define DEBUGF(...)
+#endif
#define USB_EP0_IDLE 0
#define USB_EP0_RX 1
@@ -86,7 +89,7 @@ static void readFIFO(struct usb_endpoint *ep, unsigned int size)
register unsigned char *ptr = (unsigned char*)EP_PTR(ep);
register unsigned int *ptr32 = (unsigned int*)ptr;
- register unsigned int s = size / 4;
+ register unsigned int s = size >> 2;
register unsigned int x;
if(size > 0)
@@ -333,7 +336,7 @@ void usb_drv_stall(int endpoint, bool stall, bool in)
select_endpoint(endpoint);
- if(endpoint == 0)
+ if(endpoint == EP_CONTROL)
{
if(stall)
REG_USB_REG_CSR0 |= USB_CSR0_SENDSTALL;
@@ -458,6 +461,8 @@ int usb_drv_recv(int endpoint, void* ptr, int length)
void usb_drv_set_test_mode(int mode)
{
+ DEBUGF("usb_drv_set_test_mode(%d)", mode);
+
switch(mode)
{
case 0: