diff --git a/AUTHORS b/AUTHORS index 62cfc2711..a02fa719c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -70,7 +70,7 @@ Sanei internal code: Adrian Perez Jorge, Andreas Beck, Andreas Czechanowski, Christian Bucher, David Mosberger-Tang, Frank Zago, Henning Meier-Geinitz, Jeff Freedman, - Jochen Eisinger, Marcio Teixeira, Yuri Dario + Jochen Eisinger, Marcio Teixeira, Yuri Dario, Gerhard Jaeger Please also read the file PROJECTS for projects that are planned or not yet included into the SANE distribution. diff --git a/sanei/sanei_lm983x.c b/sanei/sanei_lm983x.c index 3164f2ea5..5f38ce143 100644 --- a/sanei/sanei_lm983x.c +++ b/sanei/sanei_lm983x.c @@ -54,7 +54,7 @@ #include #include -#define BACKEND_NAME sanei_lm983x +#define BACKEND_NAME sanei_lm983x /**< the name of this module for dbg */ #include "../include/sane/sane.h" #include "../include/sane/sanei_debug.h" @@ -66,13 +66,23 @@ #define _MIN(a,b) ((a) < (b) ? (a) : (b)) #define _MAX(a,b) ((a) > (b) ? (a) : (b)) -#define _CMD_BYTE_CNT 4 -#define _MAX_RETRY 20 -#define _LM9831_MAX_REG 0x7f -#define _MAX_TRANSFER_SIZE 60 +#define _CMD_BYTE_CNT 4 /**< header for LM983x transfers */ +#define _MAX_RETRY 20 /**< number of tries for reset */ +#define _LM9831_MAX_REG 0x7f /**< number of LM983x bytes */ +#define _MAX_TRANSFER_SIZE 60 /**< max. number of bytes to transfer */ /******************************* the functions *******************************/ +/** + * function to initialize this library, currently only enables the debugging + * functionality + */ +void +sanei_lm983x_init( void ) +{ + DBG_INIT(); +} + /** * function to write one data byte to a specific LM983x register * @@ -87,7 +97,7 @@ SANE_Status sanei_lm983x_write_byte( SANE_Int fd, SANE_Byte reg, SANE_Byte value ) { - return sanei_lm983x_write( fd, reg, &value, 1, SANE_FALSE ); + return sanei_lm983x_write( fd, reg, &value, 1, SANE_FALSE ); } /** @@ -292,7 +302,7 @@ SANE_Bool sanei_lm983x_reset( SANE_Int fd ) if( _CMD_BYTE_CNT == write( fd, cmd_buffer, _CMD_BYTE_CNT )) { /* Then read the register in question */ - u_long cbBytes = 1; + unsigned long cbBytes = 1; if( read( fd, &tmp, cbBytes )) { @@ -308,6 +318,7 @@ SANE_Bool sanei_lm983x_reset( SANE_Int fd ) wrt_buffer[2] = 0; wrt_buffer[3] = 1; wrt_buffer[4] = 0; /* <--- The data for the register */ + /* should this be 0x20???? */ /* We will attempt to reset it but we really don't do * anything if this fails