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 }