- 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. */
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include "../include/sane/config.h"
@ -74,6 +75,10 @@ lock_parport (void)
fd = sanei_umax_pp_getparport ();
if ((fd > 0) && (!locked))
{
if (ioctl (sanei_umax_pp_getparport (), PPCLAIM))
{
return (UMAX1220P_BUSY);
}
#ifdef PPGETMODE
if (ioctl (fd, PPGETMODE, &exmode))
exmode = IEEE1284_MODE_COMPAT;
@ -83,10 +88,6 @@ lock_parport (void)
mode = IEEE1284_MODE_EPP;
ioctl (fd, PPNEGOT, &mode);
ioctl (fd, PPSETMODE, &mode);
if (ioctl (sanei_umax_pp_getparport (), PPCLAIM))
{
return (UMAX1220P_BUSY);
}
locked = 1;
}
#else
@ -306,6 +307,7 @@ sanei_umax_pp_cancel (void)
int
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 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 */
sanei_umax_pp_EndSession ();
if (autoset)
sanei_umax_pp_setauto (1);
else
sanei_umax_pp_setauto (0);
if (color)
col = RGB_MODE;
if (sanei_umax_pp_StartScan
(x + 144, y, width, height, dpi, col, gain, highlight, rbpp, rtw,
rth) != 1)

Wyświetl plik

@ -146,8 +146,8 @@ extern int sanei_umax_pp_cancel (void);
the width of scanned area expressed in pixels
*/
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 *rtw, int *rth);
int color, int autoset, int gain,
int highlight, int *rbpp, int *rtw, int *rth);
/* 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);
/* set auto calibration 0: no, else yes */
extern void sanei_umax_pp_setauto (int mode);
/* set umax astra model number */
extern void sanei_umax_pp_setastra (int val);