summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2020-04-13 17:04:18 +0700
committerhathach <[email protected]>2020-04-13 17:04:18 +0700
commitf4df82939955d86f6c2e826e1bc9f4b5bb713df8 (patch)
tree83c27973c090862435cf4694b2d7b6ae9745c2b9 /src
parent4f693fea15b79363dd26dd8b4c22028a550b3c6c (diff)
lpc17xx move set configdevice into set address
for removing dcd_set_config()
Diffstat (limited to 'src')
-rw-r--r--src/device/usbd.c2
-rw-r--r--src/portable/nxp/lpc17_40/dcd_lpc17_40.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c
index 2adac429c..55d6aa7eb 100644
--- a/src/device/usbd.c
+++ b/src/device/usbd.c
@@ -542,8 +542,6 @@ static bool process_control_request(uint8_t rhport, tusb_control_request_t const
{
uint8_t const cfg_num = (uint8_t) p_request->wValue;
- dcd_set_config(rhport, cfg_num);
-
if ( !_usbd_dev.configured && cfg_num ) TU_ASSERT( process_set_config(rhport, cfg_num) );
_usbd_dev.configured = cfg_num ? 1 : 0;
diff --git a/src/portable/nxp/lpc17_40/dcd_lpc17_40.c b/src/portable/nxp/lpc17_40/dcd_lpc17_40.c
index 884260f31..1d755ce63 100644
--- a/src/portable/nxp/lpc17_40/dcd_lpc17_40.c
+++ b/src/portable/nxp/lpc17_40/dcd_lpc17_40.c
@@ -205,13 +205,15 @@ void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0);
sie_write(SIE_CMDCODE_SET_ADDRESS, 1, 0x80 | dev_addr); // 7th bit is : device_enable
+
+ // Also Set Configure Device to enable non-control endpoint response
+ sie_write(SIE_CMDCODE_CONFIGURE_DEVICE, 1, 1);
}
void dcd_set_config(uint8_t rhport, uint8_t config_num)
{
(void) rhport;
(void) config_num;
- sie_write(SIE_CMDCODE_CONFIGURE_DEVICE, 1, 1);
}
void dcd_remote_wakeup(uint8_t rhport)
@@ -273,6 +275,7 @@ static uint8_t control_ep_read(void * buffer, uint8_t len)
//--------------------------------------------------------------------+
// DCD Endpoint Port
//--------------------------------------------------------------------+
+
bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc)
{
(void) rhport;