diff options
| -rw-r--r-- | firmware/export/tcc77x.h | 3 | ||||
| -rw-r--r-- | firmware/export/tcc780x.h | 3 | ||||
| -rw-r--r-- | firmware/system.c | 1 | ||||
| -rw-r--r-- | firmware/target/arm/usb-tcc.c | 6 |
4 files changed, 12 insertions, 1 deletions
diff --git a/firmware/export/tcc77x.h b/firmware/export/tcc77x.h index 9ff8ade..5346e58 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 1e2052c..b10b311 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 52be7a1..290452b 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 aa4c2e4..6f15e68 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) { |