forked from mfulz_github/qmk_firmware
Add missing device deconfiguration-on-error statements to the host mode demos and projects.
This commit is contained in:
parent
137ce280c1
commit
d9c16402b9
|
@ -174,6 +174,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||||
{
|
{
|
||||||
puts_P(PSTR("Error Enabling Audio Stream.\r\n"));
|
puts_P(PSTR("Error Enabling Audio Stream.\r\n"));
|
||||||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||||
|
USB_Host_SetDeviceConfiguration(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,6 +185,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||||
{
|
{
|
||||||
puts_P(PSTR("Error Setting Audio Sampling Frequency.\r\n"));
|
puts_P(PSTR("Error Setting Audio Sampling Frequency.\r\n"));
|
||||||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||||
|
USB_Host_SetDeviceConfiguration(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -182,6 +182,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||||
{
|
{
|
||||||
puts_P(PSTR("Error Enabling Audio Stream.\r\n"));
|
puts_P(PSTR("Error Enabling Audio Stream.\r\n"));
|
||||||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||||
|
USB_Host_SetDeviceConfiguration(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,6 +193,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||||
{
|
{
|
||||||
puts_P(PSTR("Error Setting Audio Sampling Frequency.\r\n"));
|
puts_P(PSTR("Error Setting Audio Sampling Frequency.\r\n"));
|
||||||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||||
|
USB_Host_SetDeviceConfiguration(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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"));
|
puts_P(PSTR("Error Setting Report Protocol Mode or Not a Valid Joystick.\r\n"));
|
||||||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||||
|
USB_Host_SetDeviceConfiguration(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -202,6 +202,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||||
{
|
{
|
||||||
puts_P(PSTR("Could not Set Boot Protocol Mode.\r\n"));
|
puts_P(PSTR("Could not Set Boot Protocol Mode.\r\n"));
|
||||||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||||
|
USB_Host_SetDeviceConfiguration(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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"));
|
puts_P(PSTR("Error Setting Report Protocol Mode or Not a Valid Keyboard.\r\n"));
|
||||||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||||
|
USB_Host_SetDeviceConfiguration(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -185,6 +185,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||||
{
|
{
|
||||||
puts_P(PSTR("Could not Set Boot Protocol Mode.\r\n"));
|
puts_P(PSTR("Could not Set Boot Protocol Mode.\r\n"));
|
||||||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||||
|
USB_Host_SetDeviceConfiguration(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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"));
|
puts_P(PSTR("Error Setting Report Protocol Mode or Not a Valid Mouse.\r\n"));
|
||||||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||||
|
USB_Host_SetDeviceConfiguration(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -134,6 +134,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||||
" -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);
|
" -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);
|
||||||
|
|
||||||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||||
|
USB_Host_SetDeviceConfiguration(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -120,6 +120,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||||
if (RNDIS_Host_InitializeDevice(&Ethernet_RNDIS_Interface_Host) != HOST_SENDCONTROL_Successful)
|
if (RNDIS_Host_InitializeDevice(&Ethernet_RNDIS_Interface_Host) != HOST_SENDCONTROL_Successful)
|
||||||
{
|
{
|
||||||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||||
|
USB_Host_SetDeviceConfiguration(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,6 +129,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||||
&PacketFilter, sizeof(PacketFilter)) != HOST_SENDCONTROL_Successful)
|
&PacketFilter, sizeof(PacketFilter)) != HOST_SENDCONTROL_Successful)
|
||||||
{
|
{
|
||||||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||||
|
USB_Host_SetDeviceConfiguration(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,6 +137,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
|
||||||
&MACAddress, sizeof(MACAddress)) != HOST_SENDCONTROL_Successful)
|
&MACAddress, sizeof(MACAddress)) != HOST_SENDCONTROL_Successful)
|
||||||
{
|
{
|
||||||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||||
|
USB_Host_SetDeviceConfiguration(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue