mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-09-10 17:15:43 +00:00
Fix logic bug in the incomplete Android Accessory Host demo preventing correct detection of an attached Android Accessory Mode device.
This commit is contained in:
@@ -191,6 +191,8 @@ void Android_Host_Task(void)
|
||||
/* Send the control request for the Android device to switch to accessory mode */
|
||||
Pipe_SelectPipe(PIPE_CONTROLPIPE);
|
||||
USB_Host_SendControlRequest(NULL);
|
||||
|
||||
puts_P(PSTR("Switching to Accessory Mode.\r\n"));
|
||||
|
||||
/* Wait until USB device disconnected */
|
||||
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
|
||||
|
||||
@@ -59,7 +59,8 @@ uint8_t ProcessDeviceDescriptor(void)
|
||||
if (DeviceDescriptor.VendorID != ANDROID_VENDOR_ID)
|
||||
return IncorrectAndroidDevice;
|
||||
|
||||
if ((DeviceDescriptor.ProductID != ANDROID_ACCESSORY_PRODUCT_ID) ||
|
||||
/* Check the product ID to determine if the Android device is in accessory mode */
|
||||
if ((DeviceDescriptor.ProductID != ANDROID_ACCESSORY_PRODUCT_ID) &&
|
||||
(DeviceDescriptor.ProductID != ANDROID_ACCESSORY_ADB_PRODUCT_ID))
|
||||
{
|
||||
return NonAccessoryModeAndroidDevice;
|
||||
|
||||
Reference in New Issue
Block a user