mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
correct cdc connected
This commit is contained in:
parent
2def363e49
commit
0e62cb1425
@ -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)
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user