From 8f949842dbe78f6e0dada5de50b55757f06a7293 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sun, 26 Jun 2011 06:59:13 -0300 Subject: [PATCH] atusb/fw/: remove unused items when building the USB driver for the boot loader - usb/atu2.c (NUM_EPS), board.h (NUM_EPS): moved definition to board.h - board.h (NUM_EPS): use one EP for the boot loader, two for the application - usb/atu2.c (ep_init): initialize EP 1 only in an application build --- atusb/fw/board.h | 6 ++++++ atusb/fw/usb/atu2.c | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/atusb/fw/board.h b/atusb/fw/board.h index cd94e24..9f16e5a 100644 --- a/atusb/fw/board.h +++ b/atusb/fw/board.h @@ -64,6 +64,12 @@ #define BOARD_MAX_mA 40 +#ifdef BOOT_LOADER +#define NUM_EPS 1 +#else +#define NUM_EPS 2 +#endif + #define HAS_BOARD_SERNUM extern uint8_t board_sernum[42]; diff --git a/atusb/fw/usb/atu2.c b/atusb/fw/usb/atu2.c index 74295ba..5d078ae 100644 --- a/atusb/fw/usb/atu2.c +++ b/atusb/fw/usb/atu2.c @@ -40,9 +40,6 @@ #endif -#define NUM_EPS 2 - - struct ep_descr eps[NUM_EPS]; @@ -199,6 +196,8 @@ static void ep_init(void) eps[0].state = EP_IDLE; eps[0].size = 64; +#ifndef BOOT_LOADER + UENUM = 1; UECONX = (1 << RSTDT) | (1 << EPEN); /* enable */ UECFG0X = (1 << EPTYPE1) | (1 << EPDIR); /* bulk IN */ @@ -211,6 +210,8 @@ static void ep_init(void) eps[1].state = EP_IDLE; eps[1].size = 64; + +#endif }