diff --git a/backend/genesys_gl124.c b/backend/genesys_gl124.c index ea44606fa..482d4244e 100644 --- a/backend/genesys_gl124.c +++ b/backend/genesys_gl124.c @@ -301,57 +301,6 @@ static Sensor_Profile *get_sensor_profile(int sensor_type, int dpi, int half_ccd return &(sensors[idx]); } -/** @brief motor profile - * search for the database of motor profiles and get the best one. Each - * profile is at full step and at a reference exposure. Use LiDE 110 table - * by default. - * @param motor_type motor id - * @param exposure exposure time - * @return a pointer to a Motor_Profile struct - */ -static Motor_Profile *get_motor_profile(int motor_type, int exposure) -{ - unsigned int i; - int idx; - - i=0; - idx=-1; - while(i=exposure - && motors[i].exposure>step_type; + DBG (DBG_io2, "%s: target=%d\n", __FUNCTION__, target); /* fill result with target speed */ for(i=0;iexposure; } -/**@brief compute motor step type to use - * compute the step type (full, half, quarter, ...) to use based - * on target resolution - * @param dev device description - * @param exposure sensor exposure - * @return 0 for full step - * 1 for half step - * 2 for quarter step - * 3 for eighth step - */ -static int gl124_compute_step_type(Genesys_Device *dev, int exposure) -{ -Motor_Profile *profile; - - profile=get_motor_profile(dev->model->motor_type,exposure); - return profile->step_type; -} - static SANE_Status gl124_init_motor_regs_scan (Genesys_Device * dev, @@ -1040,7 +973,8 @@ gl124_init_motor_regs_scan (Genesys_Device * dev, dev->motor.base_ydpi, scan_step_type, factor, - dev->model->motor_type); + dev->model->motor_type, + motors); RIE(gl124_send_slope_table (dev, SCAN_TABLE, scan_table, scan_steps)); RIE(gl124_send_slope_table (dev, BACKTRACK_TABLE, scan_table, scan_steps)); @@ -1060,7 +994,8 @@ gl124_init_motor_regs_scan (Genesys_Device * dev, dev->motor.base_ydpi, scan_step_type, factor, - dev->model->motor_type); + dev->model->motor_type, + motors); RIE(gl124_send_slope_table (dev, STOP_TABLE, fast_table, fast_steps)); RIE(gl124_send_slope_table (dev, FAST_TABLE, fast_table, fast_steps)); @@ -1619,7 +1554,7 @@ gl124_init_scan_regs (Genesys_Device * dev, else { exposure_time = gl124_compute_exposure (dev, used_res, half_ccd); - scan_step_type = gl124_compute_step_type(dev, exposure_time); + scan_step_type = sanei_genesys_compute_step_type(motors, dev->model->motor_type, exposure_time); } DBG (DBG_info, "gl124_init_scan_regs : exposure_time=%d pixels\n", exposure_time); @@ -3895,7 +3830,8 @@ static Genesys_Command_Set gl124_cmd_set = { NULL, gl124_send_shading_data, gl124_calculate_current_setup, - gl124_boot + gl124_boot, + NULL }; SANE_Status diff --git a/backend/genesys_gl124.h b/backend/genesys_gl124.h index 1b78af348..4f69d7a88 100644 --- a/backend/genesys_gl124.h +++ b/backend/genesys_gl124.h @@ -702,10 +702,11 @@ static #endif SANE_Status gl124_feed (Genesys_Device * dev, unsigned int steps); -#ifndef UNIT_TESTING -static -#endif -SANE_Status +GENESYS_STATIC SANE_Status gl124_stop_action (Genesys_Device * dev); +GENESYS_STATIC SANE_Status +gl124_send_slope_table (Genesys_Device * dev, int table_nr, + uint16_t * slope_table, int steps); + /* vim: set sw=2 cino=>2se-1sn-1s{s^-1st0(0u0 smarttab expandtab: */ diff --git a/backend/genesys_gl646.c b/backend/genesys_gl646.c index e7008327e..5c76904c0 100644 --- a/backend/genesys_gl646.c +++ b/backend/genesys_gl646.c @@ -5789,6 +5789,7 @@ static Genesys_Command_Set gl646_cmd_set = { gl646_move_to_ta, NULL, NULL, + NULL, NULL }; diff --git a/backend/genesys_gl841.c b/backend/genesys_gl841.c index 45b1d7ef7..318def8dd 100644 --- a/backend/genesys_gl841.c +++ b/backend/genesys_gl841.c @@ -6363,6 +6363,7 @@ static Genesys_Command_Set gl841_cmd_set = { NULL, gl841_send_shading_data, gl841_calculate_current_setup, + NULL, NULL }; diff --git a/backend/genesys_gl843.c b/backend/genesys_gl843.c index d2a47d54b..2b0d8fa2e 100644 --- a/backend/genesys_gl843.c +++ b/backend/genesys_gl843.c @@ -4462,7 +4462,8 @@ static Genesys_Command_Set gl843_cmd_set = { gl843_move_to_ta, gl843_send_shading_data, gl843_calculate_current_setup, - gl843_boot + gl843_boot, + NULL }; SANE_Status diff --git a/backend/genesys_gl846.c b/backend/genesys_gl846.c index b58ab9195..399169353 100644 --- a/backend/genesys_gl846.c +++ b/backend/genesys_gl846.c @@ -3696,7 +3696,8 @@ static Genesys_Command_Set gl846_cmd_set = { NULL, gl846_send_shading_data, gl846_calculate_current_setup, - gl846_boot + gl846_boot, + NULL }; SANE_Status diff --git a/backend/genesys_gl847.c b/backend/genesys_gl847.c index b807af9af..7c4d19c17 100644 --- a/backend/genesys_gl847.c +++ b/backend/genesys_gl847.c @@ -3769,7 +3769,8 @@ static Genesys_Command_Set gl847_cmd_set = { NULL, gl847_send_shading_data, gl847_calculate_current_setup, - gl847_boot + gl847_boot, + NULL }; SANE_Status diff --git a/backend/genesys_low.h b/backend/genesys_low.h index 4f85feccf..b1f29e10f 100644 --- a/backend/genesys_low.h +++ b/backend/genesys_low.h @@ -571,6 +571,24 @@ typedef struct Genesys_Command_Set */ SANE_Status (*asic_boot) (Genesys_Device * dev, SANE_Bool cold); + /** + * Scan register setting interface + */ + SANE_Status (*init_scan_regs) (Genesys_Device * dev, + Genesys_Register_Set * reg, + float xres, + float yres, + float startx, + float starty, + float pixels, + float lines, + unsigned int depth, + unsigned int channels, + int scan_method, + int scan_mode, + int color_filter, + unsigned int flags); + } Genesys_Command_Set; /** @brief structure to describe a scanner model