diff options
| author | Ha Thach <[email protected]> | 2020-04-11 15:49:34 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-04-11 15:49:34 +0700 |
| commit | 04a06ec40147f1f44cfee0567667cc97bbe900ee (patch) | |
| tree | e1efa890fa3ceb93e15244ba6e6df3e61c701910 /src/portable/microchip | |
| parent | 4748b349a2812fb2e08f7dfd04866afd50acb98f (diff) | |
| parent | 13a3081d308828ae6e4b9a40bb8ac7bf5b0e424c (diff) | |
Merge branch 'master' into refactor-irqhandler
Diffstat (limited to 'src/portable/microchip')
| -rw-r--r-- | src/portable/microchip/samd/dcd_samd.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/portable/microchip/samd/dcd_samd.c b/src/portable/microchip/samd/dcd_samd.c index 420526bfa..2c01f8017 100644 --- a/src/portable/microchip/samd/dcd_samd.c +++ b/src/portable/microchip/samd/dcd_samd.c @@ -154,10 +154,23 @@ void dcd_set_config (uint8_t rhport, uint8_t config_num) void dcd_remote_wakeup(uint8_t rhport) { (void) rhport; - USB->DEVICE.CTRLB.bit.UPRSM = 1; } +// disconnect by disabling internal pull-up resistor on D+/D- +void dcd_disconnect(uint8_t rhport) +{ + (void) rhport; + USB->DEVICE.CTRLB.reg |= USB_DEVICE_CTRLB_DETACH; +} + +// connect by enabling internal pull-up resistor on D+/D- +void dcd_connect(uint8_t rhport) +{ + (void) rhport; + USB->DEVICE.CTRLB.reg &= ~USB_DEVICE_CTRLB_DETACH; +} + /*------------------------------------------------------------------*/ /* DCD Endpoint port *------------------------------------------------------------------*/ |
