From 5a2a808329c3f1cf915e7dae3d08cd5f32b81466 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Tue, 27 Mar 2018 18:30:08 +0200 Subject: [PATCH] [nrf52840] remove startup delay after software reset in USB driver (#2637) Signed-off-by: Robert Lubos --- examples/platforms/nrf52840/platform-config.h | 10 ---------- examples/platforms/nrf52840/usb-cdc-uart.c | 7 ------- 2 files changed, 17 deletions(-) diff --git a/examples/platforms/nrf52840/platform-config.h b/examples/platforms/nrf52840/platform-config.h index 0942956e0..4e473ca56 100644 --- a/examples/platforms/nrf52840/platform-config.h +++ b/examples/platforms/nrf52840/platform-config.h @@ -317,16 +317,6 @@ #define LOG_TIMESTAMP_ENABLE 1 #endif -/** - * @def USB_INITIAL_DELAY_MS - * - * Init delay for USB driver, used when software reset was detected to help OS to re-enumerate the device. - * - */ -#ifndef USB_INITIAL_DELAY_MS -#define USB_INITIAL_DELAY_MS 600 -#endif - /** * @def USB_HOST_UART_CONFIG_DELAY_MS * diff --git a/examples/platforms/nrf52840/usb-cdc-uart.c b/examples/platforms/nrf52840/usb-cdc-uart.c index 7ecc9ea44..f1711969a 100644 --- a/examples/platforms/nrf52840/usb-cdc-uart.c +++ b/examples/platforms/nrf52840/usb-cdc-uart.c @@ -205,13 +205,6 @@ static void processConnection(void) // Provide some delay so the OS can re-enumerate the device in case of reset. if (sUsbState.mReadyToStart) { - if (((otPlatGetResetReason(NULL) == OT_PLAT_RESET_REASON_EXTERNAL) || - (otPlatGetResetReason(NULL) == OT_PLAT_RESET_REASON_SOFTWARE)) && - (otPlatAlarmMilliGetNow() < USB_INITIAL_DELAY_MS)) - { - return; - } - sUsbState.mReadyToStart = false; if (nrf_drv_usbd_is_enabled())