Add missing device deconfiguration-on-error statements to the host mode demos and projects.

This commit is contained in:
Dean Camera 2011-07-08 07:56:40 +00:00
parent 137ce280c1
commit d9c16402b9
9 changed files with 13 additions and 0 deletions

View File

@ -174,6 +174,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
{
puts_P(PSTR("Error Enabling Audio Stream.\r\n"));
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
USB_Host_SetDeviceConfiguration(0);
return;
}
@ -184,6 +185,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
{
puts_P(PSTR("Error Setting Audio Sampling Frequency.\r\n"));
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
USB_Host_SetDeviceConfiguration(0);
return;
}

View File

@ -182,6 +182,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
{
puts_P(PSTR("Error Enabling Audio Stream.\r\n"));
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
USB_Host_SetDeviceConfiguration(0);
return;
}
@ -192,6 +193,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
{
puts_P(PSTR("Error Setting Audio Sampling Frequency.\r\n"));
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
USB_Host_SetDeviceConfiguration(0);
return;
}

View File

@ -206,6 +206,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
{
puts_P(PSTR("Error Setting Report Protocol Mode or Not a Valid Joystick.\r\n"));
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
USB_Host_SetDeviceConfiguration(0);
return;
}

View File

@ -202,6 +202,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
{
puts_P(PSTR("Could not Set Boot Protocol Mode.\r\n"));
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
USB_Host_SetDeviceConfiguration(0);
return;
}

View File

@ -228,6 +228,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
{
puts_P(PSTR("Error Setting Report Protocol Mode or Not a Valid Keyboard.\r\n"));
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
USB_Host_SetDeviceConfiguration(0);
return;
}

View File

@ -185,6 +185,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
{
puts_P(PSTR("Could not Set Boot Protocol Mode.\r\n"));
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
USB_Host_SetDeviceConfiguration(0);
return;
}

View File

@ -215,6 +215,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
{
puts_P(PSTR("Error Setting Report Protocol Mode or Not a Valid Mouse.\r\n"));
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
USB_Host_SetDeviceConfiguration(0);
return;
}

View File

@ -134,6 +134,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
" -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
USB_Host_SetDeviceConfiguration(0);
return;
}

View File

@ -120,6 +120,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
if (RNDIS_Host_InitializeDevice(&Ethernet_RNDIS_Interface_Host) != HOST_SENDCONTROL_Successful)
{
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
USB_Host_SetDeviceConfiguration(0);
return;
}
@ -128,6 +129,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
&PacketFilter, sizeof(PacketFilter)) != HOST_SENDCONTROL_Successful)
{
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
USB_Host_SetDeviceConfiguration(0);
return;
}
@ -135,6 +137,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
&MACAddress, sizeof(MACAddress)) != HOST_SENDCONTROL_Successful)
{
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
USB_Host_SetDeviceConfiguration(0);
return;
}