[sane-devel] HP5400 XPA support patch

Paul Menzel paulepanter at users.sourceforge.net
Mon Mar 11 14:12:37 UTC 2013


Dear Tyson,


Am Sonntag, den 10.03.2013, 13:32 -0400 schrieb Tyson Whitehead:
> I cleaned up (switched the coding style to match the existing one used
> in the HP5400 driver) and updated (resolved the various conflicts to get
> it to apply against 1.0.22) Martin's XPA support patch for the HP5400.
> 
> http://sourceforge.net/projects/hp5400backend/

Thank you for doing that.

> Please find the updated version attached.

Could you please resend this patch with the diff inlined as it is easier
to reply to it.

    $ git format-patch -1

You can add an introductory note in front of it by doing and separate
this by adding the following line.

---- 8< ---- >8 ----

See `git help am`.

Like this seems to be from 2010? Was this backend always developed
outside of SANE upstream and merged every now and then?

> It works for me.  I don't know why the original never made it out of
> the HP5400 repo.

Do you know if it was ever submitted for review? Does Martin agree with
getting this into SANE upstream repository?


> --- sane-backends-1.0.22/backend/hp5400.h-xpa   2010-12-01 18:49:58.000000000 -0500
> +++ sane-backends-1.0.22/backend/hp5400.h       2012-10-14 23:34:42.043244625 -0400
> @@ -70,4 +70,12 @@
>  };
>  
> +enum ScanSource
> +{
> +  SRC_FLATBED,
> +  SRC_XPA,
> +  SRC_NOLAMP
> +};
> +
> +
>  /* In case we ever need to track multiple models */
>  typedef struct
> @@ -136,4 +144,10 @@
>                                  * internally. Leave it for the time being as it
>                                  * may be needed later. */
> +  int iLamp;                   /* experimental setting, do not use.
> +                                * Should the lamp be turned off (iLamp=1) 
> +                                * or not (iLamp=0) */
> +  int iSource;                 /* scan_source 
> +                                * Normal or 
> +                                * Transparenty adapter (=XPA) */
>  }
>  TScanParams;
> --- sane-backends-1.0.22/backend/hp5400_internal.c-xpa  2010-12-01 18:49:58.000000000 -0500
> +++ sane-backends-1.0.22/backend/hp5400_internal.c      2012-10-16 18:56:39.342199492 -0400
> @@ -152,4 +152,9 @@
>         return 0;
>      }
> +  else
> +    {
> +      if (WriteByte (pHWParams->iXferHandle, 0x0000, 0x00) == 0)
> +       return 0;
> +    }
>    return -1;
>  }
> @@ -157,21 +162,44 @@
>  HP5400_SANE_STATIC
>  int
> -WarmupLamp (int iHandle)
> +WarmupLamp (int iHandle, int iSource)
>  {
> -  int i = 30;                  /* Max 30 seconds, 15 is typical for cold start? */
> -  int couldRead;
> -  unsigned char dataVerify[0x02];
> -
> -  /* Keep writing 01 to 0000 until no error... */
> -  unsigned char data0000[] = {
> -    0x01
> -  };
> -  unsigned char data0300[3];
> +  int iWait;   /* Max 60 seconds,
> +                * 15 is typical for cold start of flatbed,
> +                * xpa takes much longer */
> +
> +  {                            /* Try to set the right lamp to make scan succeed */
> +    char flag;
> +    if (iSource==SRC_XPA)
> +      {
> +      iWait = 60;
> +      flag=0x02;/*mdvh  turn on  xpa lamp*/

Could you please also revise your patch regarding coding style stuff.
Like a space in front of the comment?

[…]


Thanks,

Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20130311/1a95f674/attachment.pgp>


More information about the sane-devel mailing list