mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
Merge pull request #328 from majbthrd/nuc_connect
nuvoton: add dcd_disconnect() dcd_connect()
This commit is contained in:
commit
36b33ee775
@ -430,4 +430,16 @@ void dcd_isr(uint8_t rhport)
|
||||
USBD_IRQHandler();
|
||||
}
|
||||
|
||||
void dcd_disconnect(uint8_t rhport)
|
||||
{
|
||||
(void) rhport;
|
||||
usb_detach();
|
||||
}
|
||||
|
||||
void dcd_connect(uint8_t rhport)
|
||||
{
|
||||
(void) rhport;
|
||||
usb_attach();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -446,4 +446,16 @@ void dcd_isr(uint8_t rhport)
|
||||
USBD_IRQHandler();
|
||||
}
|
||||
|
||||
void dcd_disconnect(uint8_t rhport)
|
||||
{
|
||||
(void) rhport;
|
||||
usb_detach();
|
||||
}
|
||||
|
||||
void dcd_connect(uint8_t rhport)
|
||||
{
|
||||
(void) rhport;
|
||||
usb_attach();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -126,6 +126,11 @@ static void usb_attach(void)
|
||||
USBD->PHYCTL |= USBD_PHYCTL_DPPUEN_Msk;
|
||||
}
|
||||
|
||||
static void usb_detach(void)
|
||||
{
|
||||
USBD->PHYCTL &= ~USBD_PHYCTL_DPPUEN_Msk;
|
||||
}
|
||||
|
||||
static void usb_control_send_zlp(void)
|
||||
{
|
||||
USBD->CEPINTSTS = USBD_CEPINTSTS_STSDONEIF_Msk;
|
||||
@ -647,4 +652,16 @@ void dcd_isr(uint8_t rhport)
|
||||
USBD_IRQHandler();
|
||||
}
|
||||
|
||||
void dcd_disconnect(uint8_t rhport)
|
||||
{
|
||||
(void) rhport;
|
||||
usb_detach();
|
||||
}
|
||||
|
||||
void dcd_connect(uint8_t rhport)
|
||||
{
|
||||
(void) rhport;
|
||||
usb_attach();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user