From f4b12e16e489103a84abd4235ea7760760488679 Mon Sep 17 00:00:00 2001 From: rob Date: Mon, 9 Mar 2009 22:02:30 +0000 Subject: [PATCH] =?utf8?q?A=20few=20tweaks=20to=20get=20USB=20support=20co?= =?utf8?q?mpiling=20again=20on=20TCC=20targets=20(part=20of=20FS#9917=20by?= =?utf8?q?=20Micha=C3=ABl=20Burtin).?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20264 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/tcc77x.h | 3 +++ firmware/export/tcc780x.h | 3 +++ firmware/system.c | 1 + firmware/target/arm/usb-tcc.c | 6 +++++- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/firmware/export/tcc77x.h b/firmware/export/tcc77x.h index 9ff8adea3..5346e585a 100644 --- a/firmware/export/tcc77x.h +++ b/firmware/export/tcc77x.h @@ -258,4 +258,7 @@ /* USB 2.0 device system MMR base address */ #define USB_BASE 0x90000b00 +#define USB_NUM_ENDPOINTS 3 +#define USB_DEVBSS_ATTR IBSS_ATTR + #endif diff --git a/firmware/export/tcc780x.h b/firmware/export/tcc780x.h index 1e2052c4b..b10b311fe 100644 --- a/firmware/export/tcc780x.h +++ b/firmware/export/tcc780x.h @@ -229,4 +229,7 @@ /* USB 2.0 device system MMR base address */ #define USB_BASE 0xf0010000 +#define USB_NUM_ENDPOINTS 3 +#define USB_DEVBSS_ATTR IBSS_ATTR + #endif diff --git a/firmware/system.c b/firmware/system.c index 52be7a1a7..290452b0a 100644 --- a/firmware/system.c +++ b/firmware/system.c @@ -24,6 +24,7 @@ #include "kernel.h" #include "thread.h" #include "string.h" +#include "file.h" #ifndef SIMULATOR long cpu_frequency SHAREDBSS_ATTR = CPU_FREQ; diff --git a/firmware/target/arm/usb-tcc.c b/firmware/target/arm/usb-tcc.c index aa4c2e422..6f15e68af 100644 --- a/firmware/target/arm/usb-tcc.c +++ b/firmware/target/arm/usb-tcc.c @@ -122,7 +122,7 @@ void usb_drv_release_endpoint(int ep) int flags; ep = ep & 0x7f; - if (ep < 1 || ep > NUM_ENDPOINTS) + if (ep < 1 || ep > USB_NUM_ENDPOINTS) return ; flags = disable_irq_save(); @@ -744,6 +744,10 @@ void usb_enable(bool on) usb_core_exit(); } +void usb_attach(void) +{ + usb_enable(true); +} int usb_detect(void) { -- 2.11.4.GIT