X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/e338cb6f329d6bf948abad88637f81436ee90daf..9d2613d90868b59ac48ccce8b652819d5cd388d5:/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c diff --git a/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c b/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c index 1aaa8141e..3222b770e 100644 --- a/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c +++ b/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c @@ -50,7 +50,6 @@ int main(void) LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); - /* Startup message */ puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY "Bluetooth Host Demo running.\r\n" ESC_INVERSE_OFF)); @@ -111,6 +110,7 @@ void EVENT_USB_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode) { puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n")); printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode); + printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode); printf_P(PSTR(" -- In State %d\r\n"), USB_HostState); LEDs_SetAllLEDs(LEDMASK_USB_ERROR); @@ -139,14 +139,11 @@ void Bluetooth_Management_Task(void) LEDs_SetAllLEDs(LEDS_LED1); /* Wait until USB device disconnected */ - while (USB_IsConnected); + USB_HostState = HOST_STATE_WaitForDeviceRemoval; break; } puts_P(PSTR("Bluetooth Dongle Detected.\r\n")); - - /* Select the control pipe for the request transfer */ - Pipe_SelectPipe(PIPE_CONTROLPIPE); /* Set the device configuration to the first configuration (rarely do devices use multiple configurations) */ if ((ErrorCode = USB_Host_SetDeviceConfiguration(1)) != HOST_SENDCONTROL_Successful) @@ -158,7 +155,7 @@ void Bluetooth_Management_Task(void) LEDs_SetAllLEDs(LEDS_LED1); /* Wait until USB device disconnected */ - while (USB_IsConnected); + USB_HostState = HOST_STATE_WaitForDeviceRemoval; break; } @@ -181,7 +178,7 @@ void Bluetooth_Management_Task(void) LEDs_SetAllLEDs(LEDS_LED1); /* Wait until USB device disconnected */ - while (USB_IsConnected); + USB_HostState = HOST_STATE_WaitForDeviceRemoval; break; } @@ -189,9 +186,5 @@ void Bluetooth_Management_Task(void) USB_HostState = HOST_STATE_Ready; break; - case HOST_STATE_Ready: - /* Do nothing, Bluetooth stack will take care of enumeration */ - - break; } }