diff options
| author | hathach <[email protected]> | 2019-12-26 22:31:29 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2019-12-26 22:31:29 +0700 |
| commit | 0da45c2e78598dc311bfe08fa845e8276e299418 (patch) | |
| tree | 2814f357d2db5799e4546c491e51e819353657ff /src | |
| parent | b5684c5c102dbe54988357d1ea0fd457f6cbfc5c (diff) | |
clean up
Diffstat (limited to 'src')
| -rw-r--r-- | src/portable/microchip/samd/dcd_samd.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/portable/microchip/samd/dcd_samd.c b/src/portable/microchip/samd/dcd_samd.c index eccc9c097..5f904b313 100644 --- a/src/portable/microchip/samd/dcd_samd.c +++ b/src/portable/microchip/samd/dcd_samd.c @@ -93,33 +93,40 @@ void dcd_init (uint8_t rhport) USB->DEVICE.INTENSET.reg = /* USB_DEVICE_INTENSET_SOF | */ USB_DEVICE_INTENSET_EORST; } +#if CFG_TUSB_MCU == OPT_MCU_SAMD51 + void dcd_int_enable(uint8_t rhport) { (void) rhport; - -#if CFG_TUSB_MCU == OPT_MCU_SAMD51 NVIC_EnableIRQ(USB_0_IRQn); NVIC_EnableIRQ(USB_1_IRQn); NVIC_EnableIRQ(USB_2_IRQn); NVIC_EnableIRQ(USB_3_IRQn); -#elif CFG_TUSB_MCU == OPT_MCU_SAMD21 - NVIC_EnableIRQ(USB_IRQn); -#endif } void dcd_int_disable(uint8_t rhport) { (void) rhport; - -#if CFG_TUSB_MCU == OPT_MCU_SAMD51 NVIC_DisableIRQ(USB_3_IRQn); NVIC_DisableIRQ(USB_2_IRQn); NVIC_DisableIRQ(USB_1_IRQn); NVIC_DisableIRQ(USB_0_IRQn); +} + #elif CFG_TUSB_MCU == OPT_MCU_SAMD21 + +void dcd_int_enable(uint8_t rhport) +{ + (void) rhport; + NVIC_EnableIRQ(USB_IRQn); +} + +void dcd_int_disable(uint8_t rhport) +{ + (void) rhport; NVIC_DisableIRQ(USB_IRQn); -#endif } +#endif void dcd_set_address (uint8_t rhport, uint8_t dev_addr) { |
