diff options
| author | Reimu NotMoe <[email protected]> | 2024-12-27 00:59:45 +0800 |
|---|---|---|
| committer | Reimu NotMoe <[email protected]> | 2024-12-27 00:59:45 +0800 |
| commit | 0192b2a9b0a8a7a300326c27ebd59f15cb34790e (patch) | |
| tree | c11a6e9d81439beee8f1a7cf9c02a421b01aea3e /src | |
| parent | f409472998cfba4f6be0534912c1afd48e0d6816 (diff) | |
dcd_pic: implement dcd_deinit()
Diffstat (limited to 'src')
| -rw-r--r-- | src/portable/microchip/pic/dcd_pic.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/portable/microchip/pic/dcd_pic.c b/src/portable/microchip/pic/dcd_pic.c index 9ffeb0811..04c54059f 100644 --- a/src/portable/microchip/pic/dcd_pic.c +++ b/src/portable/microchip/pic/dcd_pic.c @@ -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); |
