kopia lustrzana https://gitlab.com/sane-project/backends
Added parport-mode detection.
rodzic
95d80717ed
commit
fb5b49b4b9
|
@ -231,7 +231,7 @@ typedef const struct mode_param
|
|||
#define _E_INTERNAL (_FIRST_ERR-7) /* internal error */
|
||||
#define _E_BUSY (_FIRST_ERR-8) /* device is already in use */
|
||||
#define _E_ABORT (_FIRST_ERR-9) /* operation aborted */
|
||||
#define _E_LOCK (_FIRST_ERR-10) /* can´t lock resource */
|
||||
#define _E_LOCK (_FIRST_ERR-10) /* can't lock resource */
|
||||
#define _E_NOSUPP (_FIRST_ERR-11) /* feature or device not supported */
|
||||
#define _E_NORESOURCE (_FIRST_ERR-12) /* out of memo, resource busy... */
|
||||
#define _E_VERSION (_FIRST_ERR-19) /* version conflict */
|
||||
|
@ -241,7 +241,7 @@ typedef const struct mode_param
|
|||
#define _E_NO_PORT (_FIRST_ERR-23) /* requested port does not exist */
|
||||
#define _E_REGISTER (_FIRST_ERR-24) /* cannot register this device */
|
||||
#define _E_SEQUENCE (_FIRST_ERR-30) /* caller sequence does not match */
|
||||
#define _E_NO_ASIC (_FIRST_ERR-31) /* can´t detect ASIC */
|
||||
#define _E_NO_ASIC (_FIRST_ERR-31) /* can't detect ASIC */
|
||||
|
||||
#define _E_LAMP_NOT_IN_POS (_FIRST_ERR-40)
|
||||
#define _E_LAMP_NOT_STABLE (_FIRST_ERR-41)
|
||||
|
|
|
@ -318,7 +318,7 @@ static int miscSetFastMode( pScanData ps )
|
|||
}
|
||||
|
||||
/*
|
||||
* reaching this point, we´re back in SPP mode and there´s no need
|
||||
* reaching this point, we're back in SPP mode and there's no need
|
||||
* to restore at shutdown...
|
||||
*/
|
||||
ps->IO.lastPortMode = 0xFFFF;
|
||||
|
@ -494,16 +494,35 @@ _LOC int MiscInitPorts( pScanData ps, int port )
|
|||
ps->IO.pbEppDataPort = (UShort)port+4;
|
||||
|
||||
#else
|
||||
|
||||
int mode;
|
||||
|
||||
if( NULL == ps )
|
||||
return _E_NULLPTR;
|
||||
|
||||
DBG(DBG_LOW, "Using EPP-mode\n" );
|
||||
ps->IO.portMode = _PORT_EPP;
|
||||
if( SANE_STATUS_GOOD != sanei_pp_getmode( ps->pardev, &mode )) {
|
||||
DBG(DBG_HIGH, "Cannot get port mode!\n" );
|
||||
return _E_NO_PORT;
|
||||
}
|
||||
|
||||
if( mode & SANEI_PP_MODE_SPP ) {
|
||||
DBG(DBG_LOW, "Setting SPP-mode\n" );
|
||||
ps->IO.portMode = _PORT_SPP;
|
||||
}
|
||||
if( mode & SANEI_PP_MODE_BIDI ) {
|
||||
DBG(DBG_LOW, "Setting PS/2-mode\n" );
|
||||
ps->IO.portMode = _PORT_BIDI;
|
||||
}
|
||||
if( mode & SANEI_PP_MODE_EPP ) {
|
||||
DBG(DBG_LOW, "Setting EPP-mode\n" );
|
||||
ps->IO.portMode = _PORT_EPP;
|
||||
}
|
||||
if( mode & SANEI_PP_MODE_ECP ) {
|
||||
DBG(DBG_HIGH, "ECP detected --> not supported\n" );
|
||||
return _E_NOSUPP;
|
||||
}
|
||||
|
||||
_VAR_NOT_USED( port );
|
||||
#endif
|
||||
|
||||
return _OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -87,17 +87,15 @@
|
|||
#include "../include/sane/sanei.h"
|
||||
#include "../include/sane/saneopts.h"
|
||||
|
||||
#define BACKEND_VERSION "0.01-3"
|
||||
#define BACKEND_VERSION "0.01-4"
|
||||
#define BACKEND_NAME plustek_pp
|
||||
#include "../include/sane/sanei_backend.h"
|
||||
#include "../include/sane/sanei_config.h"
|
||||
#include "../include/sane/sanei_thread.h"
|
||||
#include "../include/sane/sanei_pp.h"
|
||||
|
||||
#ifdef HAVE_IOPERM
|
||||
# define _BACKEND_ENABLED
|
||||
# define _USER_MODE
|
||||
#endif
|
||||
#define _BACKEND_ENABLED
|
||||
#define _USER_MODE
|
||||
|
||||
#include "plustek-pp.h"
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue