Skip to content

Commit efd9b01

Browse files
committed
Correct code with wrong call to USB_OpenStream
- see PR NETMF#439
1 parent b8980a5 commit efd9b01

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

DeviceCode/pal/COM/ComDirector.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,17 @@ BOOL DebuggerPort_Initialize( COM_HANDLE ComPortNum )
1919
if(USB_CONFIG_ERR_OK != USB_Configure( ConvertCOM_UsbController(ComPortNum), NULL ))
2020
return FALSE;
2121

22-
if(!USB_Initialize( ConvertCOM_UsbController(ComPortNum) ))
23-
return FALSE;
24-
25-
return USB_OpenStream( ConvertCOM_UsbStream(ComPortNum), USB_DEBUG_EP_WRITE, USB_DEBUG_EP_READ );
22+
if(USB_Initialize(ConvertCOM_UsbController(ComPortNum)))
23+
{
24+
#if defined(USB_ALLOW_CONFIGURATION_OVERRIDE)
25+
// because it was called from debugger port USB_Initialize alreadt opened the USB stream
26+
return TRUE;
27+
#else
28+
return USB_OpenStream( ConvertCOM_UsbStream(HalSystemConfig.DebuggerPorts[0]), USB_DEBUG_EP_WRITE, USB_DEBUG_EP_READ );
29+
#endif
30+
31+
}
32+
break;
2633
#endif
2734

2835
#ifdef FEATURE_SOCKETS

0 commit comments

Comments
 (0)