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. */
|
||||
bulkUsbDev.hDev = NULL;
|
||||
bulkUsbDev.hWinUSBDev = NULL;
|
||||
bulkUsbDev.evReader = NULL;
|
||||
bulkUsbDev.pipeBulkIn = INVALID_PIPE_ID;
|
||||
bulkUsbDev.pipeBulkOut = INVALID_PIPE_ID;
|
||||
/* Open the usb device. */
|
||||
|
@ -306,11 +307,13 @@ static void UblClose(void)
|
|||
if (bulkUsbDev.evReader != NULL)
|
||||
{
|
||||
(void)CloseHandle(bulkUsbDev.evReader);
|
||||
bulkUsbDev.evReader = NULL;
|
||||
}
|
||||
/* close the winusb device */
|
||||
if (bulkUsbDev.hWinUSBDev != NULL)
|
||||
{
|
||||
(void)WinUsb_Free(bulkUsbDev.hWinUSBDev);
|
||||
bulkUsbDev.hWinUSBDev = NULL;
|
||||
}
|
||||
/* reset bulk OUT and IN pipes */
|
||||
bulkUsbDev.pipeBulkOut = INVALID_PIPE_ID;
|
||||
|
@ -319,6 +322,7 @@ static void UblClose(void)
|
|||
if (bulkUsbDev.hDev != NULL)
|
||||
{
|
||||
(void)CloseHandle(bulkUsbDev.hDev);
|
||||
bulkUsbDev.hDev = NULL;
|
||||
}
|
||||
} /*** end of UblClose ***/
|
||||
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue