From 9dd189d973da64e033a0c5c2adb3d94b23153d94 Mon Sep 17 00:00:00 2001 From: Adam Malinowski Date: Mon, 17 Feb 2020 17:20:18 +0100 Subject: Increase power off time for USB device USB SSD drives seem to have big enough capacitors to keep them powered for more than 100ms. This change increase the power off time to 500ms to let them discharge and reset the drive properly. Change-Id: I5e1f647d3d6ce72881bd628de7ef23255ea844ff --- src/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 9224422..2cfda4d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -46,6 +46,7 @@ #define DELAY_100MS 100000 +#define DELAY_500MS 500000 #define CCDT_SDMUX_STR "sd-mux" #define CCDT_SDWIRE_STR "sd-wire" @@ -505,7 +506,7 @@ int selectTarget(Target target, CCOptionValue options[]) { if (target == T_DUT) { pinState &= ~UM_DEVICE_PWR; ret |= ftdi_set_bitmode(ftdi, pinState, BITMODE_CBUS); - usleep(DELAY_100MS); + usleep(DELAY_500MS); pinState |= UM_DEVICE_PWR; ret |= ftdi_set_bitmode(ftdi, pinState, BITMODE_CBUS); usleep(DELAY_100MS); @@ -517,7 +518,7 @@ int selectTarget(Target target, CCOptionValue options[]) { pinState &= ~UM_DUT_LED; pinState &= ~UM_DEVICE_PWR; ret |= ftdi_set_bitmode(ftdi, pinState, BITMODE_CBUS); - usleep(DELAY_100MS); + usleep(DELAY_500MS); pinState |= UM_DEVICE_PWR; ret |= ftdi_set_bitmode(ftdi, pinState, BITMODE_CBUS); usleep(DELAY_100MS); -- cgit v1.2.3