mirror of https://github.com/FOME-Tech/openblt.git
Refs #1839. Reset bulkUsbDev after close.
git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@1083 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
This commit is contained in:
parent
fda0af2658
commit
74c8b78e17
|
@ -232,6 +232,7 @@ static uint8_t UblOpen(LPCGUID guid)
|
||||||
/* Init device members. */
|
/* Init device members. */
|
||||||
bulkUsbDev.hDev = NULL;
|
bulkUsbDev.hDev = NULL;
|
||||||
bulkUsbDev.hWinUSBDev = NULL;
|
bulkUsbDev.hWinUSBDev = NULL;
|
||||||
|
bulkUsbDev.evReader = NULL;
|
||||||
bulkUsbDev.pipeBulkIn = INVALID_PIPE_ID;
|
bulkUsbDev.pipeBulkIn = INVALID_PIPE_ID;
|
||||||
bulkUsbDev.pipeBulkOut = INVALID_PIPE_ID;
|
bulkUsbDev.pipeBulkOut = INVALID_PIPE_ID;
|
||||||
/* Open the usb device. */
|
/* Open the usb device. */
|
||||||
|
@ -306,11 +307,13 @@ static void UblClose(void)
|
||||||
if (bulkUsbDev.evReader != NULL)
|
if (bulkUsbDev.evReader != NULL)
|
||||||
{
|
{
|
||||||
(void)CloseHandle(bulkUsbDev.evReader);
|
(void)CloseHandle(bulkUsbDev.evReader);
|
||||||
|
bulkUsbDev.evReader = NULL;
|
||||||
}
|
}
|
||||||
/* close the winusb device */
|
/* close the winusb device */
|
||||||
if (bulkUsbDev.hWinUSBDev != NULL)
|
if (bulkUsbDev.hWinUSBDev != NULL)
|
||||||
{
|
{
|
||||||
(void)WinUsb_Free(bulkUsbDev.hWinUSBDev);
|
(void)WinUsb_Free(bulkUsbDev.hWinUSBDev);
|
||||||
|
bulkUsbDev.hWinUSBDev = NULL;
|
||||||
}
|
}
|
||||||
/* reset bulk OUT and IN pipes */
|
/* reset bulk OUT and IN pipes */
|
||||||
bulkUsbDev.pipeBulkOut = INVALID_PIPE_ID;
|
bulkUsbDev.pipeBulkOut = INVALID_PIPE_ID;
|
||||||
|
@ -319,6 +322,7 @@ static void UblClose(void)
|
||||||
if (bulkUsbDev.hDev != NULL)
|
if (bulkUsbDev.hDev != NULL)
|
||||||
{
|
{
|
||||||
(void)CloseHandle(bulkUsbDev.hDev);
|
(void)CloseHandle(bulkUsbDev.hDev);
|
||||||
|
bulkUsbDev.hDev = NULL;
|
||||||
}
|
}
|
||||||
} /*** end of UblClose ***/
|
} /*** end of UblClose ***/
|
||||||
|
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue