From c3140af27436e14593ea5db412ab4c39f568870e Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 28 Nov 2018 17:54:11 +0700 Subject: [PATCH] correct TUD_OPT_HIGH_SPEED --- src/portable/nxp/lpc17xx/dcd_lpc175x_6x.c | 2 +- src/tusb_option.h | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/portable/nxp/lpc17xx/dcd_lpc175x_6x.c b/src/portable/nxp/lpc17xx/dcd_lpc175x_6x.c index c0dea38c9..c0275abb2 100644 --- a/src/portable/nxp/lpc17xx/dcd_lpc175x_6x.c +++ b/src/portable/nxp/lpc17xx/dcd_lpc175x_6x.c @@ -55,7 +55,7 @@ typedef struct ATTR_ALIGNED(4) uint32_t next; //------------- Word 1 -------------// - uint16_t mode : 2; // either 00 normal or 01 ATLE(auto length extraction) + uint16_t atle_mode : 2; // 00: normal, 01: ATLE (auto length extraction) uint16_t next_valid : 1; uint16_t : 1; ///< reserved uint16_t isochronous : 1; // is an iso endpoint diff --git a/src/tusb_option.h b/src/tusb_option.h index b64a61e42..e1aec3302 100644 --- a/src/tusb_option.h +++ b/src/tusb_option.h @@ -121,7 +121,13 @@ // Which roothub port is configured as device #define TUD_OPT_RHPORT ( (CFG_TUSB_RHPORT0_MODE & OPT_MODE_DEVICE) ? 0 : ((CFG_TUSB_RHPORT1_MODE & OPT_MODE_DEVICE) ? 1 : -1) ) -#define TUD_OPT_HIGH_SPEED ( (CFG_TUSB_RHPORT0_MODE & (OPT_MODE_DEVICE | OPT_MODE_HIGH_SPEED)) || (CFG_TUSB_RHPORT1_MODE & (OPT_MODE_DEVICE | OPT_MODE_HIGH_SPEED)) ) + + +#if TUD_OPT_RHPORT == 0 +#define TUD_OPT_HIGH_SPEED ( CFG_TUSB_RHPORT0_MODE & OPT_MODE_HIGH_SPEED ) +#else +#define TUD_OPT_HIGH_SPEED ( CFG_TUSB_RHPORT1_MODE & OPT_MODE_HIGH_SPEED ) +#endif #define TUSB_OPT_DEVICE_ENABLED ( TUD_OPT_RHPORT >= 0 )