Skip to content

Commit

Permalink
dcd_pic: implement dcd_deinit()
Browse files Browse the repository at this point in the history
  • Loading branch information
ReimuNotMoe committed Dec 26, 2024
1 parent f409472 commit 0192b2a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/portable/microchip/pic/dcd_pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,19 @@ bool dcd_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) {
return true;
}

bool dcd_deinit(uint8_t rhport)
{
U1CON = 0;
U1IE = 0;
U1OTGIE = 0;
#if TU_PIC_INT_SIZE == 4
U1PWRCCLR = _U1PWRC_USUSPEND_MASK | _U1PWRC_USBPWR_MASK;
#else
U1PWRC &= ~(_U1PWRC_USUSPEND_MASK | _U1PWRC_USBPWR_MASK);
#endif
return true;
}

void dcd_int_enable(uint8_t rhport)
{
intr_enable(rhport);
Expand Down

0 comments on commit 0192b2a

Please sign in to comment.