summaryrefslogtreecommitdiff
path: root/tinyusb
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-04-17 17:06:40 +0700
committerhathach <[email protected]>2018-04-17 17:06:40 +0700
commit0e62cb1425f704ee3ac334f92992d5b0cfd2817d (patch)
tree848776bc6d3c1579bf640244c1a28cf68df221a4 /tinyusb
parent2def363e49627aca5f9d500fc480885f4fa911dd (diff)
correct cdc connected
Diffstat (limited to 'tinyusb')
-rw-r--r--tinyusb/class/cdc/cdc_device.c5
-rw-r--r--tinyusb/portable/nordic/nrf5x/hal_nrf5x.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/tinyusb/class/cdc/cdc_device.c b/tinyusb/class/cdc/cdc_device.c
index dbcebe5ee..df19cdfcd 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 47ce9f945..f77bdaa12 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);