diff --git a/tinyusb/class/cdc/cdc_device.c b/tinyusb/class/cdc/cdc_device.c index dbcebe5e..df19cdfc 100644 --- a/tinyusb/class/cdc/cdc_device.c +++ b/tinyusb/class/cdc/cdc_device.c @@ -88,9 +88,8 @@ STATIC_VAR cdcd_data_t cdcd_data[CONTROLLER_DEVICE_NUMBER]; //--------------------------------------------------------------------+ bool tud_n_cdc_connected(uint8_t rhport) { - // Either RTS (bit 1) or DTR (bit 0) active considered as connected - // May only check for DTR only - return (cdcd_data[rhport].line_state != 0); + // DTR (bit 0) active isconsidered as connected + return BIT_TEST_(cdcd_data[rhport].line_state, 0); } uint8_t tud_n_cdc_get_line_state (uint8_t rhport) diff --git a/tinyusb/portable/nordic/nrf5x/hal_nrf5x.c b/tinyusb/portable/nordic/nrf5x/hal_nrf5x.c index 47ce9f94..f77bdaa1 100644 --- a/tinyusb/portable/nordic/nrf5x/hal_nrf5x.c +++ b/tinyusb/portable/nordic/nrf5x/hal_nrf5x.c @@ -57,6 +57,9 @@ /*------------------------------------------------------------------*/ /* MACRO TYPEDEF CONSTANT ENUM *------------------------------------------------------------------*/ + +#define USB_NVIC_PRIO 7 + // TODO must cover SD present but not enabled #ifdef SOFTDEVICE_PRESENT #define POWER_DETECT NRF_EVT_POWER_USB_DETECTED @@ -301,7 +304,7 @@ void power_usb_event_handler(uint32_t event) // nrf_drv_usbd_errata_104() // Enable interrupt, Priorities 0,1,4,5 (nRF52) are reserved for SoftDevice - NVIC_SetPriority(USBD_IRQn, 7); + NVIC_SetPriority(USBD_IRQn, USB_NVIC_PRIO); NVIC_ClearPendingIRQ(USBD_IRQn); NVIC_EnableIRQ(USBD_IRQn);