Hi, On Thu, Sep 29, 2005 at 05:05:18PM +0200, Gerhard Jaeger wrote: > please find attached a patch to make the OpticSlim M12 scanner > work. Work here means, scan a sheet.
I have included the patch into CVS with some modifications. Please check if it still works. See below for details. > Calibration is not available, How does that work with sheet-fed scanners at all? Is there also some kind of calibration area? > area selection is limited - positioning does currently not work. That means that length and width can be changed but not tl-x and tl-y? > The patch is meant as a starting point to make gt68xx based sheet-fed scanner > work. It should apply to the current cvs. > > @Henning: It's up to you to include it. Maybe some changes are needed - I'll > test them. > > Ciao, > Gerhard > --- sane-backends/doc/descriptions/gt68xx.desc.orig 2005-09-27 > 11:19:02.000000000 +0200 > +++ sane-backends/doc/descriptions/gt68xx.desc 2005-09-29 > 16:57:39.000000000 +0200 [...] > + if (s->dev->model->flags & GT68XX_FLAG_SHEET_FED) > + { > + s->val[OPT_BACKTRACK_LINES].w = 0x3f; > + DISABLE (OPT_BACKTRACK_LINES); > + } > + Is it really necessary to disable that option unconditionally? Otherwise I would move the check for GT68XX_FLAG_SHEET_FED up to the normal setting of that option (normally 0x3f is used for CCD). > - RIE (gt68xx_scanner_calibrate (s, &scan_request)); > + if ( !(s->dev->model->flags & GT68XX_FLAG_SHEET_FED)) { > + RIE (gt68xx_scanner_calibrate (s, &scan_request)); > + } I haven't changed that because coarse and fine calibration is turned off anyway for that scanner. > --- sane-backends/backend/gt68xx_devices.c.orig 2005-09-27 > 11:18:57.000000000 +0200 > +++ sane-backends/backend/gt68xx_devices.c 2005-09-29 11:29:05.000000000 > +0200 I used a new command_set for sheet-fed types. this way we have more flexibility. Also there is one more level of indirection (always call gt68xx_device_*, not gt68xx_generic_* or gt68xx_gt6816_* directly). > --- sane-backends/backend/gt68xx_generic.c.orig 2005-09-27 > 11:18:57.000000000 +0200 > +++ sane-backends/backend/gt68xx_generic.c 2005-09-29 11:29:49.000000000 > +0200 > @@ -96,10 +96,17 @@ gt68xx_generic_read_scanned_data (GT68xx > > RIE (gt68xx_device_req (dev, req, req)); > > - if (req[0] == 0) > - *ready = SANE_TRUE; > + *ready = SANE_FALSE; > + if (dev->model->flags & GT68XX_FLAG_SHEET_FED) > + { > + if (req[0] == 0 && req[1] == 0x35 ) > + *ready = SANE_TRUE; > + } Is this really necessary? I know that 95% of the gt68xx scanners return 00 35 but I only test for 00 beacuse of the 5% which don't return the 35. If it also works with the test only for the 00, I would prefer to keep the old version. At the moment, i have apllied your patch, however. in gt68xx_geneirc_set_exposure-time: > + if (dev->model->flags & GT68XX_FLAG_SHEET_FED) > + return SANE_STATUS_GOOD; > + Not applied. Added a check in gt68xx_high.c instead. > --- sane-backends/backend/gt68xx_gt6816.c.orig 2005-06-01 > 13:28:18.000000000 +0200 > +++ sane-backends/backend/gt68xx_gt6816.c 2005-09-29 11:23:28.000000000 > +0200 > @@ -217,6 +217,9 @@ gt6816_carriage_home (GT68xx_Device * de > { > GT68xx_Packet req; > > + if (dev->model->flags & GT68XX_FLAG_SHEET_FED) > + return SANE_STATUS_GOOD; > + Not applied. Added checks in gt68xx.c instead. In stop scan: > { > GT68xx_Packet req; > > + if (dev->model->flags & GT68XX_FLAG_SHEET_FED) > + { > + memset (req, 0, sizeof (req)); > + req[0] = 0x42; > + req[1] = 0x01; Not applied. Used gt6801_stop_scan instead in the new command_set. Bye, Henning