mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-10 03:44:22 +00:00
nuc505: change dcd_set_config() behavior
This commit is contained in:
parent
eb2aaa5de8
commit
b9fca0bbb4
@ -112,8 +112,6 @@ static struct
|
|||||||
uint16_t total_bytes;
|
uint16_t total_bytes;
|
||||||
} ctrl_in_xfer;
|
} ctrl_in_xfer;
|
||||||
|
|
||||||
static volatile bool configuration_changed;
|
|
||||||
|
|
||||||
static volatile struct xfer_ctl_t *current_dma_xfer;
|
static volatile struct xfer_ctl_t *current_dma_xfer;
|
||||||
|
|
||||||
|
|
||||||
@ -219,7 +217,6 @@ static void bus_reset(void)
|
|||||||
/* Reset USB device address */
|
/* Reset USB device address */
|
||||||
USBD->FADDR = 0;
|
USBD->FADDR = 0;
|
||||||
|
|
||||||
configuration_changed = false;
|
|
||||||
current_dma_xfer = NULL;
|
current_dma_xfer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,7 +302,6 @@ void dcd_set_config(uint8_t rhport, uint8_t config_num)
|
|||||||
{
|
{
|
||||||
(void) rhport;
|
(void) rhport;
|
||||||
(void) config_num;
|
(void) config_num;
|
||||||
configuration_changed = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void dcd_remote_wakeup(uint8_t rhport)
|
void dcd_remote_wakeup(uint8_t rhport)
|
||||||
@ -579,15 +575,14 @@ void dcd_irq_handler(uint8_t rhport)
|
|||||||
else if (cep_state & USBD_CEPINTSTS_STSDONEIF_Msk)
|
else if (cep_state & USBD_CEPINTSTS_STSDONEIF_Msk)
|
||||||
{
|
{
|
||||||
/* given ACK from host has happened, we can now set the address (if not already done) */
|
/* given ACK from host has happened, we can now set the address (if not already done) */
|
||||||
if((USBD->FADDR != assigned_address) && (USBD->FADDR == 0)) USBD->FADDR = assigned_address;
|
if((USBD->FADDR != assigned_address) && (USBD->FADDR == 0))
|
||||||
|
|
||||||
if (configuration_changed)
|
|
||||||
{
|
{
|
||||||
|
USBD->FADDR = assigned_address;
|
||||||
|
|
||||||
for (enum ep_enum ep_index = PERIPH_EPA; ep_index < PERIPH_MAX_EP; ep_index++)
|
for (enum ep_enum ep_index = PERIPH_EPA; ep_index < PERIPH_MAX_EP; ep_index++)
|
||||||
{
|
{
|
||||||
if (USBD->EP[ep_index].EPCFG & USBD_EPCFG_EPEN_Msk) USBD->EP[ep_index].EPRSPCTL = USBD_EPRSPCTL_TOGGLE_Msk;
|
if (USBD->EP[ep_index].EPCFG & USBD_EPCFG_EPEN_Msk) USBD->EP[ep_index].EPRSPCTL = USBD_EPRSPCTL_TOGGLE_Msk;
|
||||||
}
|
}
|
||||||
configuration_changed = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
USBD->CEPINTEN = USBD_CEPINTEN_SETUPPKIEN_Msk;
|
USBD->CEPINTEN = USBD_CEPINTEN_SETUPPKIEN_Msk;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user