summaryrefslogtreecommitdiff
path: root/backend/genesys_gl124.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-04-27 06:51:24 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-04-27 06:51:24 +0200
commitf3843702a12cf46f9cd4d1be772055ec6893a1bb (patch)
tree3f3d8fe1f2b756dc2cd9fcff7b2e8e53539278ba /backend/genesys_gl124.c
parentb2802d98d4486d6afc585062f4ca02fddf829dc5 (diff)
Release 1.0.25+git20150425-1
Diffstat (limited to 'backend/genesys_gl124.c')
-rw-r--r--backend/genesys_gl124.c39
1 files changed, 29 insertions, 10 deletions
diff --git a/backend/genesys_gl124.c b/backend/genesys_gl124.c
index 86aa4ee..eaac873 100644
--- a/backend/genesys_gl124.c
+++ b/backend/genesys_gl124.c
@@ -852,7 +852,7 @@ gl124_init_motor_regs_scan (Genesys_Device * dev,
}
else
{
- min_speed = 600;
+ min_speed = 900;
if(dev->model->ccd_type==MOTOR_CANONLIDE110)
{
min_speed = 300;
@@ -2108,6 +2108,17 @@ gl124_slow_back_home (Genesys_Device * dev, SANE_Bool wait_until_home)
return SANE_STATUS_GOOD;
}
+ /* feed a little first */
+ if (strcmp (dev->model->name, "canon-lide-210") == 0)
+ {
+ status = gl124_feed (dev, 20, SANE_TRUE);
+ if (status != SANE_STATUS_GOOD)
+ {
+ DBG (DBG_error, "%s: failed to do initial feed: %s\n", __FUNCTION__, sane_strstatus (status));
+ return status;
+ }
+ }
+
memcpy (local_reg, dev->reg, GENESYS_GL124_MAX_REGS * sizeof (Genesys_Register_Set));
resolution=sanei_genesys_get_lowest_dpi(dev);
@@ -2202,12 +2213,13 @@ gl124_slow_back_home (Genesys_Device * dev, SANE_Bool wait_until_home)
/** @brief moves the slider to steps at motor base dpi
* @param dev device to work on
* @param steps number of steps to move
+ * @param reverse true is moving backward
* */
#ifndef UNIT_TESTING
static
#endif
SANE_Status
-gl124_feed (Genesys_Device * dev, unsigned int steps)
+gl124_feed (Genesys_Device * dev, unsigned int steps, int reverse)
{
Genesys_Register_Set local_reg[GENESYS_GL124_MAX_REGS];
SANE_Status status;
@@ -2242,9 +2254,7 @@ gl124_feed (Genesys_Device * dev, unsigned int steps)
SCAN_FLAG_IGNORE_LINE_DISTANCE);
if (status != SANE_STATUS_GOOD)
{
- DBG (DBG_error,
- "gl124_feed: failed to set up registers: %s\n",
- sane_strstatus (status));
+ DBG (DBG_error, "%s: failed to set up registers: %s\n", __FUNCTION__, sane_strstatus (status));
DBGCOMPLETED;
return status;
}
@@ -2262,6 +2272,13 @@ gl124_feed (Genesys_Device * dev, unsigned int steps)
r = sanei_genesys_get_address (local_reg, REG01);
r->value &= ~REG01_SCAN;
+ /* set up for reverse if needed */
+ if(reverse)
+ {
+ r = sanei_genesys_get_address (local_reg, REG02);
+ r->value |= REG02_MTRREV;
+ }
+
/* send registers */
RIE (dev->model->cmd_set->bulk_write_register (dev, local_reg, GENESYS_GL124_MAX_REGS));
@@ -2653,7 +2670,7 @@ gl124_init_regs_for_scan (Genesys_Device * dev)
if(channels*dev->settings.yres>=600 && move>700)
{
- status = gl124_feed (dev, move-500);
+ status = gl124_feed (dev, move-500, SANE_FALSE);
if (status != SANE_STATUS_GOOD)
{
DBG (DBG_error, "%s: failed to move to scan area\n",__FUNCTION__);
@@ -3511,12 +3528,13 @@ gl124_init_gpio (Genesys_Device * dev)
DBGSTART;
/* per model GPIO layout */
- if (strcmp (dev->model->name, "canon-lide-110") == 0)
+ if ((strcmp (dev->model->name, "canon-lide-110") == 0)
+ ||(strcmp (dev->model->name, "canon-lide-120") == 0))
{
idx = 0;
}
else
- { /* canon LiDE 210 case */
+ { /* canon LiDE 210 and 220 case */
idx = 1;
}
@@ -3544,12 +3562,13 @@ gl124_init_memory_layout (Genesys_Device * dev)
DBGSTART;
/* point to per model memory layout */
- if (strcmp (dev->model->name, "canon-lide-110") == 0)
+ if ((strcmp (dev->model->name, "canon-lide-110") == 0)
+ ||(strcmp (dev->model->name, "canon-lide-120") == 0))
{
idx = 0;
}
else
- { /* canon LiDE 210 case */
+ { /* canon LiDE 210 and 220 case */
idx = 1;
}