diff options
| author | Ha Thach <[email protected]> | 2020-04-17 13:36:16 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-04-17 13:36:16 +0700 |
| commit | 85f0894fff89baaaa91a6dc3554a3149fc2fc062 (patch) | |
| tree | ae82646cb4115b3f1e0bf1f04d92fbe124cd44da /src/portable | |
| parent | 1f698076218046f8921e74b74596fc2b50f60c82 (diff) | |
| parent | b9fca0bbb4a7706e7229962759130ee0ea2587b0 (diff) | |
Merge pull request #347 from majbthrd/nuc505_config
nuc505: change dcd_set_config() behavior
Diffstat (limited to 'src/portable')
| -rw-r--r-- | src/portable/nuvoton/nuc505/dcd_nuc505.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/portable/nuvoton/nuc505/dcd_nuc505.c b/src/portable/nuvoton/nuc505/dcd_nuc505.c index af6972961..aceb6df09 100644 --- a/src/portable/nuvoton/nuc505/dcd_nuc505.c +++ b/src/portable/nuvoton/nuc505/dcd_nuc505.c @@ -112,8 +112,6 @@ static struct uint16_t total_bytes; } ctrl_in_xfer; -static volatile bool configuration_changed; - static volatile struct xfer_ctl_t *current_dma_xfer; @@ -219,7 +217,6 @@ static void bus_reset(void) /* Reset USB device address */ USBD->FADDR = 0; - configuration_changed = false; current_dma_xfer = NULL; } @@ -305,7 +302,6 @@ void dcd_set_config(uint8_t rhport, uint8_t config_num) { (void) rhport; (void) config_num; - configuration_changed = true; } void dcd_remote_wakeup(uint8_t rhport) @@ -579,15 +575,14 @@ void dcd_int_handler(uint8_t rhport) else if (cep_state & USBD_CEPINTSTS_STSDONEIF_Msk) { /* 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 (configuration_changed) + if((USBD->FADDR != assigned_address) && (USBD->FADDR == 0)) { + USBD->FADDR = assigned_address; + 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; } - configuration_changed = false; } USBD->CEPINTEN = USBD_CEPINTEN_SETUPPKIEN_Msk; |
