LEDs_SetAllLEDs(LEDS_LED1);\r
\r
/* Wait until USB device disconnected */\r
- while (USB_IsConnected);\r
+ USB_HostState = HOST_STATE_WaitForDeviceRemoval;\r
break;\r
}\r
\r
puts_P(PSTR("Bluetooth Dongle Detected.\r\n"));\r
- \r
- /* Select the control pipe for the request transfer */\r
- Pipe_SelectPipe(PIPE_CONTROLPIPE);\r
\r
/* Set the device configuration to the first configuration (rarely do devices use multiple configurations) */\r
if ((ErrorCode = USB_Host_SetDeviceConfiguration(1)) != HOST_SENDCONTROL_Successful)\r
LEDs_SetAllLEDs(LEDS_LED1);\r
\r
/* Wait until USB device disconnected */\r
- while (USB_IsConnected);\r
+ USB_HostState = HOST_STATE_WaitForDeviceRemoval;\r
break;\r
}\r
\r
LEDs_SetAllLEDs(LEDS_LED1);\r
\r
/* Wait until USB device disconnected */\r
- while (USB_IsConnected);\r
+ USB_HostState = HOST_STATE_WaitForDeviceRemoval;\r
break;\r
}\r
\r
\r
USB_HostState = HOST_STATE_Ready;\r
break;\r
- case HOST_STATE_Ready:\r
- /* Do nothing, Bluetooth stack will take care of enumeration */\r
- \r
- break;\r
}\r
}\r