diff --git a/backend/plustek-pp_misc.c b/backend/plustek-pp_misc.c index e171c0931..c4948e0cc 100644 --- a/backend/plustek-pp_misc.c +++ b/backend/plustek-pp_misc.c @@ -521,6 +521,9 @@ _LOC int MiscInitPorts( pScanData ps, int port ) return _E_NOSUPP; } + DBG(DBG_HIGH, "SPP mode used (WORKAROUND)!!!\n" ); + ps->IO.portMode = _PORT_SPP; + _VAR_NOT_USED( port ); #endif return _OK; diff --git a/backend/plustek-pp_scan.h b/backend/plustek-pp_scan.h index 5c9ea4571..c63270c07 100644 --- a/backend/plustek-pp_scan.h +++ b/backend/plustek-pp_scan.h @@ -73,7 +73,6 @@ # include # include # include -/*# include */ # include # include # include @@ -152,21 +151,26 @@ * they are for use the the MiscStartTimer function and the _DO_UDELAY macro */ #ifndef __KERNEL__ -typedef long long TimerDef, *pTimerDef; +typedef double TimerDef, *pTimerDef; #else typedef long long TimerDef, *pTimerDef; #endif -#define _MSECOND 1000 /* based on 1 us */ -#define _SECOND (1000*_MSECOND) - +#define _MSECOND 1000 /* based on 1 us */ +#define _SECOND (1000*_MSECOND) /*............................................................................. * timer topics */ #ifndef __KERNEL__ -# define _DO_UDELAY(usecs) { int i,j; for( i = usecs; i--; ) j+=i*3; } -# define _DODELAY(msecs) { int i; for( i = msecs; i--; ) usleep(1000); } +#if 0 +# warning "outb as delay!!!!" +# define _DO_UDELAY(usecs) { int i; for( i = usecs; i--; ) outb(0, 0x80); } +#else +# define _DO_UDELAY(usecs) sanei_pp_udelay(usecs) +#endif + +# define _DODELAY(msecs) { int i; for( i = msecs; i--; ) _DO_UDELAY(1000); } #else # define _DO_UDELAY(usecs) udelay(usecs) # define _DODELAY(msecs) mdelay(msecs) diff --git a/backend/plustek_pp.c b/backend/plustek_pp.c index 630d6f99e..3c855915f 100644 --- a/backend/plustek_pp.c +++ b/backend/plustek_pp.c @@ -1143,9 +1143,16 @@ SANE_Status sane_init( SANE_Int *version_code, SANE_Auth_Callback authorize ) CnfDef config; size_t len; FILE *fp; + SANE_Status res; DBG_INIT(); sanei_thread_init(); + + res = sanei_pp_init(); + if( SANE_STATUS_GOOD != res ) { + DBG( _DBG_ERROR, "Could not initialize Parport library!\n" ); + return res; + } #if defined PACKAGE && defined VERSION DBG( _DBG_SANE_INIT, "PlustekPP backend V"BACKEND_VERSION", part of "