diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2011-06-27 05:57:25 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2011-06-27 05:57:25 +0000 |
commit | dee4bc097309b289d0ba5995edc6a140529e153a (patch) | |
tree | 3833d3677f995c55a8e5e3be11d72d9fa0632129 /Demos/Host | |
parent | 84ddf237db767dd046c1b54c0005c98d8a60c76f (diff) | |
download | lufa-dee4bc097309b289d0ba5995edc6a140529e153a.tar.gz lufa-dee4bc097309b289d0ba5995edc6a140529e153a.tar.bz2 lufa-dee4bc097309b289d0ba5995edc6a140529e153a.zip |
Fix logic bug in the incomplete Android Accessory Host demo preventing correct detection of an attached Android Accessory Mode device.
Diffstat (limited to 'Demos/Host')
-rw-r--r-- | Demos/Host/Incomplete/AndroidAccessoryHost/AndroidAccessoryHost.c | 2 | ||||
-rw-r--r-- | Demos/Host/Incomplete/AndroidAccessoryHost/DeviceDescriptor.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/Demos/Host/Incomplete/AndroidAccessoryHost/AndroidAccessoryHost.c b/Demos/Host/Incomplete/AndroidAccessoryHost/AndroidAccessoryHost.c index 69202f7cd..9b5ffbea6 100644 --- a/Demos/Host/Incomplete/AndroidAccessoryHost/AndroidAccessoryHost.c +++ b/Demos/Host/Incomplete/AndroidAccessoryHost/AndroidAccessoryHost.c @@ -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; diff --git a/Demos/Host/Incomplete/AndroidAccessoryHost/DeviceDescriptor.c b/Demos/Host/Incomplete/AndroidAccessoryHost/DeviceDescriptor.c index 4e5a1d4d6..360dfad30 100644 --- a/Demos/Host/Incomplete/AndroidAccessoryHost/DeviceDescriptor.c +++ b/Demos/Host/Incomplete/AndroidAccessoryHost/DeviceDescriptor.c @@ -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; |