genesys: Move move_to_ta() calls out of *_init_regs_for_*()

merge-requests/84/head
Povilas Kanapickas 2019-06-30 14:05:29 +03:00
rodzic a92187edad
commit 14bbe802db
2 zmienionych plików z 12 dodań i 6 usunięć

Wyświetl plik

@ -3257,6 +3257,10 @@ genesys_flatbed_calibration(Genesys_Device * dev, Genesys_Sensor& sensor)
return status;
}
if (dev->settings.scan_method == ScanMethod::TRANSPARENCY) {
RIE(dev->model->cmd_set->move_to_ta(dev));
}
/* shading calibration */
status = dev->model->cmd_set->init_regs_for_shading(dev, sensor, dev->calib_reg);
if (status != SANE_STATUS_GOOD)
@ -3894,6 +3898,10 @@ genesys_start_scan (Genesys_Device * dev, SANE_Bool lamp_off)
RIE(dev->model->cmd_set->slow_back_home(dev, SANE_TRUE));
}
if (dev->settings.scan_method == ScanMethod::TRANSPARENCY) {
RIE(dev->model->cmd_set->move_to_ta(dev));
}
status = dev->model->cmd_set->init_regs_for_scan(dev, sensor);
if (status != SANE_STATUS_GOOD)
{

Wyświetl plik

@ -2868,9 +2868,8 @@ gl843_init_regs_for_shading(Genesys_Device * dev, const Genesys_Sensor& sensor,
if (dev->settings.scan_method == ScanMethod::TRANSPARENCY)
{
// FIXME: we should handle moving to TA in the caller, this function should only setup the
// registers.
gl843_move_to_ta(dev);
// note: move_to_ta() function has already been called and the sensor is at the
// transparency adapter
move = 0; // already at dev->model->y_offset_calib_ta implicitly
flags |= SCAN_FLAG_USE_XPA;
}
@ -2955,9 +2954,8 @@ gl843_init_regs_for_scan (Genesys_Device * dev, const Genesys_Sensor& sensor)
flags = 0;
if (dev->settings.scan_method == ScanMethod::TRANSPARENCY)
{
// FIXME: we should handle moving to TA in the caller, this function should only setup the
// registers.
gl843_move_to_ta(dev);
// note: move_to_ta() function has already been called and the sensor is at the
// transparency adapter
move = SANE_UNFIX(dev->model->y_offset_ta) - SANE_UNFIX(dev->model->y_offset_calib_ta);
flags |= SCAN_FLAG_USE_XPA;
}