Fixed problem, that has been reported in conjunction with

backtracking and sensor-speedup option.
merge-requests/1/head
Gerhard Jaeger 2005-04-18 07:32:34 +00:00
rodzic 64c2b9df30
commit 80f10fc89a
2 zmienionych plików z 11 dodań i 5 usunięć

Wyświetl plik

@ -41,6 +41,7 @@
* - added usb_FillLampRegs() - sets also PWMDutyCylce now
* - added UMAX3450 TPA autodetection
* - 0.49 - a_bRegs is now part of the device structure
* - fixed problem in backtracking, when speedup is enabled
* .
* <hr>
* This file is part of the SANE package.
@ -238,6 +239,7 @@ static SANE_Bool usb_WaitPos( Plustek_Device *dev, u_long to, SANE_Bool stay )
{
SANE_Bool retval;
u_char value, mclk_div, mch;
u_char r[2];
u_short ffs, step, min_ffs;
long dwTicks;
double maxf, fac, speed;
@ -321,9 +323,9 @@ static SANE_Bool usb_WaitPos( Plustek_Device *dev, u_long to, SANE_Bool stay )
if((int)fac > 25 )
usleep( 150 * 1000 );
regs[0x48] = (u_char)(ffs >> 8);
regs[0x49] = (u_char)(ffs & 0xFF);
sanei_lm983x_write(dev->fd, 0x48, &regs[0x48], 2, SANE_TRUE);
r[0] = (u_char)(ffs >> 8);
r[1] = (u_char)(ffs & 0xFF);
sanei_lm983x_write(dev->fd, 0x48, r, 2, SANE_TRUE);
if(ffs == min_ffs )
ffs = 0;
} else {

Wyświetl plik

@ -1348,7 +1348,8 @@ static SANE_Bool usb_ScanReadImage( Plustek_Device *dev,
void *pBuf, u_long dwSize )
{
static u_long dwBytes = 0;
SANE_Status res;
u_char *regs = dev->usbDev.a_bRegs;
SANE_Status res;
DBG( _DBG_READ, "usb_ScanReadImage(%lu)\n", dwSize );
@ -1361,7 +1362,10 @@ static SANE_Bool usb_ScanReadImage( Plustek_Device *dev,
if (!usb_IsDataAvailableInDRAM( dev )) {
DBG( _DBG_ERROR, "Nothing to read...\n" );
return SANE_FALSE;
}
}
/* restore the fast forward stepsize...*/
sanei_lm983x_write(dev->fd, 0x48, &regs[0x48], 2, SANE_TRUE);
}
/* HEINER: ADF */
#if 0