- added UTA detection

- version updates
DEVEL_2_0_BRANCH-1
Stéphane Voltz 2002-10-31 06:53:52 +00:00
rodzic cb0fcd408e
commit c79500306a
6 zmienionych plików z 56 dodań i 11 usunięć

Wyświetl plik

@ -1,3 +1,10 @@
2002-10-31 Stéphane Voltz <svoltz@wanadoo.fr>
* backend/umax_pp.c backend/umax_pp.h backend/umax_pp_low.h
backend/umax_pp_low.c tools/umax_pp.c: add UTA detection,
version number updates
2002-10-30 Henning Meier-Geinitz <henning@meier-geinitz.de>
* backend/dll.conf: Removed commented out gt68xx entry.

Wyświetl plik

@ -104,7 +104,7 @@
/* if you change the source, please set UMAX_PP_STATE to "devel". Do *not*
* change the UMAX_PP_BUILD. */
#define UMAX_PP_BUILD 8
#define UMAX_PP_BUILD 9
#define UMAX_PP_STATE "devel"
static int num_devices = 0;
@ -461,6 +461,16 @@ init_options (Umax_PP_Device * dev)
dev->val[OPT_LAMP_CONTROL].w = SANE_TRUE;
dev->opt[OPT_LAMP_CONTROL].cap |= SANE_CAP_ADVANCED;
/* UTA control */
dev->opt[OPT_UTA_CONTROL].name = SANE_I18N ("UTA-control");
dev->opt[OPT_UTA_CONTROL].title = SANE_I18N ("UTA on");
dev->opt[OPT_UTA_CONTROL].desc = SANE_I18N ("Sets UTA on/off");
dev->opt[OPT_UTA_CONTROL].type = SANE_TYPE_BOOL;
dev->opt[OPT_UTA_CONTROL].size = sizeof (SANE_Word);
dev->opt[OPT_UTA_CONTROL].unit = SANE_UNIT_NONE;
dev->val[OPT_UTA_CONTROL].w = SANE_TRUE;
dev->opt[OPT_UTA_CONTROL].cap |= SANE_CAP_ADVANCED | SANE_CAP_INACTIVE;
/* custom-gamma table */
dev->opt[OPT_CUSTOM_GAMMA].name = SANE_NAME_CUSTOM_GAMMA;
dev->opt[OPT_CUSTOM_GAMMA].title = SANE_TITLE_CUSTOM_GAMMA;
@ -1177,6 +1187,10 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle)
dev->next = first_dev;
first_dev = dev;
if (sanei_umax_pp_UTA () == 1)
dev->opt[OPT_UTA_CONTROL].cap &= ~SANE_CAP_INACTIVE;
*handle = dev;
DBG (3, "open: success\n");
@ -1321,6 +1335,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
case OPT_PREVIEW:
case OPT_GRAY_PREVIEW:
case OPT_LAMP_CONTROL:
case OPT_UTA_CONTROL:
case OPT_RESOLUTION:
case OPT_TL_X:
case OPT_TL_Y:
@ -1434,6 +1449,10 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
/* options with side-effects: */
case OPT_UTA_CONTROL:
dev->val[option].w = *(SANE_Word *) val;
return SANE_STATUS_GOOD;
case OPT_LAMP_CONTROL:
if (dev->state != UMAX_PP_STATE_IDLE)
{

Wyświetl plik

@ -67,6 +67,7 @@ enum Umax_PP_Option
OPT_ENHANCEMENT_GROUP,
OPT_LAMP_CONTROL,
OPT_UTA_CONTROL,
OPT_CUSTOM_GAMMA, /* use custom gamma tables? */
/* The gamma vectors MUST appear in the order gray, red, green,

Wyświetl plik

@ -404,7 +404,7 @@ sanei_umax_pp_InitPort (int port, char *name)
int fd, ectr;
int found = 0;
#if ((defined HAVE_IOPERM)||(defined HAVE_LINUX_PPDEV_H))
int mode;
int mode,ecp=0;
#endif
#ifdef HAVE_LINUX_PPDEV_H
char strmodes[160];
@ -536,6 +536,7 @@ sanei_umax_pp_InitPort (int port, char *name)
}
else
{
ecp=1;
DBG (16,
"umax_pp: mode set to PARPORT_MODE_ECP for '%s'\n",
name);
@ -600,7 +601,7 @@ sanei_umax_pp_InitPort (int port, char *name)
else if (errno != 0)
{
/* /dev/io we get an unexpected error */
DBG (1, "opening '/dev/io' got unxepected errno=%d\n", errno);
DBG (1, "opening '/dev/io' got unexpected errno=%d\n", errno);
return (0);
}
else
@ -631,12 +632,15 @@ sanei_umax_pp_InitPort (int port, char *name)
/* frob_econtrol (port, 0xe0, 4 << 5);
unsigned char ectr = inb (ECONTROL (pb));
outb ((ectr & ~m) ^ v, ECONTROL (pb)); */
if(ecp)
{
ectr = Inb (ECPCONTROL);
if (ectr != 0xFF)
{
ectr = (ectr & ~(0xE0)) ^ (4 << 5);
Outb (ECPCONTROL, ectr);
}
}
#endif /* IO_SUPPORT_MISSING */
@ -868,6 +872,13 @@ static int scannerStatus = 0;
static int epp32 = 1;
static int model = 0x15;
static int astra = 0;
static int hasUTA = 0;
int
sanei_umax_pp_UTA (void)
{
return (hasUTA);
}
int
sanei_umax_pp_ScannerStatus (void)
@ -2539,7 +2550,9 @@ retry:
if ((reg & 0x08) == 0x00)
{
reg = EPPRegisterRead (0x1C);
if ((reg & 0x10) != 0x10)
DBG (16, "UTA: reg1C=0x%02X (%s:%d)\n", reg, __FILE__, __LINE__);
if (((reg & 0x10) != 0x10) && (reg != 0x6B) && (reg != 0xAB)
&& (reg != 0x23))
{
DBG (0, "SendWord failed (reg1C=0x%02X) (%s:%d)\n", reg, __FILE__,
__LINE__);
@ -2598,9 +2611,11 @@ retry:
/* model 0x07 has always the last bit set to 1, and even bit 1 */
/* when UTA is present, we get 0x6B there */
scannerStatus = reg & 0xFC;
if (scannerStatus == 0x68)
hasUTA = 1;
reg = reg & 0x10;
if (reg != 0x10)
if ((reg != 0x10) && (scannerStatus != 0x68) && (scannerStatus != 0xA8))
{
DBG (0, "SendWord failed: acknowledge not received (%s:%d)\n", __FILE__,
__LINE__);
@ -3055,7 +3070,8 @@ retry:
if ((wait & 0x08) == 0x00)
{
reg = EPPRegisterRead (0x1C);
while ((reg & 0x10) != 0x10)
while (((reg & 0x10) != 0x10) && (reg != 0x6B) && (reg != 0xAB)
&& (reg != 0x23))
{
DBG (0,
"SendLength failed, expected reg & 0x10=0x10 , found 0x%02X (%s:%d)\n",
@ -3178,7 +3194,7 @@ retry:
/* model 0x07 has always the last bit set to 1 */
scannerStatus = reg & 0xFC;
reg = reg & 0x10;
if (reg != 0x10)
if ((reg != 0x10) && (scannerStatus != 0x68) && (scannerStatus != 0xA8))
{
DBG (0, "SendLength failed: acknowledge not received (%s:%d)\n",
__FILE__, __LINE__);
@ -3253,7 +3269,8 @@ SendData (int *cmd, int len)
/* model 0x07 has always the last bit set to 1 */
scannerStatus = reg & 0xFC;
reg = reg & 0x10;
if (reg != 0x10)
if ((reg != 0x10) && (scannerStatus != 0x68) && (scannerStatus != 0xA8)
&& (scannerStatus != 0x20))
{
DBG (0, "SendData failed: acknowledge not received (%s:%d)\n", __FILE__,
__LINE__);
@ -3348,7 +3365,7 @@ ReceiveData (int *cmd, int len)
/* model 0x07 has always the last bit set to 1 */
scannerStatus = reg & 0xF8;
reg = reg & 0x10;
if (reg != 0x10)
if ((reg != 0x10) && (scannerStatus != 0x68) && (scannerStatus != 0xA8))
{
DBG (0, "ReceiveData failed: acknowledge not received (%s:%d)\n",
__FILE__, __LINE__);

Wyświetl plik

@ -63,6 +63,7 @@ extern int sanei_umax_pp_InitCancel (void);
extern int sanei_umax_pp_Cancel (void);
extern int sanei_umax_pp_CheckModel (void);
extern int sanei_umax_pp_getauto (void);
extern int sanei_umax_pp_UTA (void);
extern void sanei_umax_pp_setauto (int mode);
#ifndef __GLOBALES__

Wyświetl plik

@ -312,7 +312,7 @@ main (int argc, char **argv)
}
i++;
found = 1;
if ((strlen (argv[i]) < 3)||(strlen (argv[i]) > 4))
if ((strlen (argv[i]) < 3) || (strlen (argv[i]) > 4))
{
Usage (argv[0]);
fprintf (stderr, "expected hex io port value ( ex: 378 )\n");
@ -367,7 +367,7 @@ main (int argc, char **argv)
}
if (trace)
{
printf ("UMAX 1220P scanning program version 2.16 starting ...\n");
printf ("UMAX 1220P scanning program version 2.17 starting ...\n");
#ifdef HAVE_LINUX_PPDEV_H
printf ("ppdev character device built-in.\n");
#endif