From 2d6bf67be33c28991fc9ab439a9fa28962ec8dd8 Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Sat, 25 Mar 2017 10:54:23 +0000 Subject: usb: cleanup usb.c --- usb/usb.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'usb') diff --git a/usb/usb.c b/usb/usb.c index ebd3179..59519fc 100644 --- a/usb/usb.c +++ b/usb/usb.c @@ -1,6 +1,7 @@ +#include +#include #include #include -#include #include #include "usb.h" @@ -11,16 +12,10 @@ #define USBFRAC_VAL 1 /* 72 MHz * 2 = 144 MHz (Top of Fraction) */ #define USBDIV_VAL 2 /* 144 MHz / 3 = 48 MHz (Bottom of Fraction) */ -/* TODO: Move this to lib somewhere */ -#define CLRPEND(n) REG_32(0xE000E280 + 4 * (n)) -#define ISR_CLRPEND(i) CLRPEND((i) / 32) = BV((i) % 32); - -#define SETENA(n) REG_32(0xE000E100 + 4 * (n)) -#define ISR_SETENA(i) SETENA((i) / 32) = BV((i) % 32); - - +/* TODO: Only use the number of endpoints that are needed */ +/* TODO: Try using static */ __attribute__ ((aligned(512))) -struct usb0_bd usb_bdt[16 * 4]; /* TODO: Only use the number of endpoints that are needed */ +struct usb0_bd usb_bdt[16 * 4]; /* usb_setup: Setup function for USB subsystem */ void usb_setup(void) -- cgit v1.2.3-54-g00ecf