From e39db005d022bf097e5acdb75ee5e290c8ef1a10 Mon Sep 17 00:00:00 2001 From: "Stephen H. Westin" Date: Thu, 29 May 2003 18:17:09 +0000 Subject: [PATCH] Altered interrupt read in canon_usb_camera_init(), since A60 seems to send 2 8-byte messages instead of one 16-byte message. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@6455 67ed7778-7388-44ab-90cf-0a291f65f57c --- camlibs/canon/usb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/camlibs/canon/usb.c b/camlibs/canon/usb.c index ca04f8cf7..bc34e2ecc 100644 --- a/camlibs/canon/usb.c +++ b/camlibs/canon/usb.c @@ -212,9 +212,12 @@ canon_usb_camera_init (Camera *camera, GPContext *context) "Step #4.2 of initialization failed! (returned %i, expected %i) " "Camera might still work though. Continuing.", i, 4); + read_bytes = 0; do { i = gp_port_check_int_fast ( camera->port, buffer, 0x10 ); - } while ( i < 0x10 && i >= 0 ); + if ( i > 0 ) + read_bytes += i; + } while ( read_bytes < 0x10 && i >= 0 ); if ( i != 0x10 ) { GP_DEBUG ( "canon_usb_camera_init() interrupt read failed, status=%d", i ); return GP_ERROR_CORRUPTED_DATA;