- added sanei_umax_pp_setauto

- added sanei_umax_pp_getauto
	- corrected mode setting before claiming parport
DEVEL_2_0_BRANCH-1
Stéphane Voltz 2002-01-06 16:23:02 +00:00
rodzic d7aefb2efe
commit e118d4e33b
2 zmienionych plików z 16 dodań i 6 usunięć

Wyświetl plik

@ -41,6 +41,7 @@
This file implements a SANE backend for Umax PP flatbed scanners. */ This file implements a SANE backend for Umax PP flatbed scanners. */
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include "../include/sane/config.h" #include "../include/sane/config.h"
@ -74,6 +75,10 @@ lock_parport (void)
fd = sanei_umax_pp_getparport (); fd = sanei_umax_pp_getparport ();
if ((fd > 0) && (!locked)) if ((fd > 0) && (!locked))
{ {
if (ioctl (sanei_umax_pp_getparport (), PPCLAIM))
{
return (UMAX1220P_BUSY);
}
#ifdef PPGETMODE #ifdef PPGETMODE
if (ioctl (fd, PPGETMODE, &exmode)) if (ioctl (fd, PPGETMODE, &exmode))
exmode = IEEE1284_MODE_COMPAT; exmode = IEEE1284_MODE_COMPAT;
@ -83,10 +88,6 @@ lock_parport (void)
mode = IEEE1284_MODE_EPP; mode = IEEE1284_MODE_EPP;
ioctl (fd, PPNEGOT, &mode); ioctl (fd, PPNEGOT, &mode);
ioctl (fd, PPSETMODE, &mode); ioctl (fd, PPSETMODE, &mode);
if (ioctl (sanei_umax_pp_getparport (), PPCLAIM))
{
return (UMAX1220P_BUSY);
}
locked = 1; locked = 1;
} }
#else #else
@ -306,6 +307,7 @@ sanei_umax_pp_cancel (void)
int int
sanei_umax_pp_start (int x, int y, int width, int height, int dpi, int color, sanei_umax_pp_start (int x, int y, int width, int height, int dpi, int color,
int autoset,
int gain, int highlight, int *rbpp, int *rtw, int *rth) int gain, int highlight, int *rbpp, int *rtw, int *rth)
{ {
int col = BW_MODE; int col = BW_MODE;
@ -316,8 +318,14 @@ sanei_umax_pp_start (int x, int y, int width, int height, int dpi, int color,
/* end session isn't done by cancel any more */ /* end session isn't done by cancel any more */
sanei_umax_pp_EndSession (); sanei_umax_pp_EndSession ();
if (autoset)
sanei_umax_pp_setauto (1);
else
sanei_umax_pp_setauto (0);
if (color) if (color)
col = RGB_MODE; col = RGB_MODE;
if (sanei_umax_pp_StartScan if (sanei_umax_pp_StartScan
(x + 144, y, width, height, dpi, col, gain, highlight, rbpp, rtw, (x + 144, y, width, height, dpi, col, gain, highlight, rbpp, rtw,
rth) != 1) rth) != 1)

Wyświetl plik

@ -146,8 +146,8 @@ extern int sanei_umax_pp_cancel (void);
the width of scanned area expressed in pixels the width of scanned area expressed in pixels
*/ */
extern int sanei_umax_pp_start (int x, int y, int width, int height, int dpi, extern int sanei_umax_pp_start (int x, int y, int width, int height, int dpi,
int color, int gain, int highlight, int *rbpp, int color, int autoset, int gain,
int *rtw, int *rth); int highlight, int *rbpp, int *rtw, int *rth);
/* reads one block of data from scanner /* reads one block of data from scanner
@ -171,6 +171,8 @@ extern int sanei_umax_pp_read (long len, int window, int dpi, int last,
*/ */
extern int sanei_umax_pp_status (void); extern int sanei_umax_pp_status (void);
/* set auto calibration 0: no, else yes */
extern void sanei_umax_pp_setauto (int mode);
/* set umax astra model number */ /* set umax astra model number */
extern void sanei_umax_pp_setastra (int val); extern void sanei_umax_pp_setastra (int val);