kopia lustrzana https://gitlab.com/sane-project/backends
genesys: Fix TA support in scanner_move()
rodzic
6a5fd2d36c
commit
3d068a9eee
|
@ -1057,6 +1057,9 @@ void scanner_move(Genesys_Device& dev, ScanMethod scan_method, unsigned steps, D
|
||||||
|
|
||||||
const auto& sensor = sanei_genesys_find_sensor(&dev, resolution, 3, scan_method);
|
const auto& sensor = sanei_genesys_find_sensor(&dev, resolution, 3, scan_method);
|
||||||
|
|
||||||
|
bool uses_secondary_head = (scan_method == ScanMethod::TRANSPARENCY ||
|
||||||
|
scan_method == ScanMethod::TRANSPARENCY_INFRARED);
|
||||||
|
|
||||||
ScanSession session;
|
ScanSession session;
|
||||||
session.params.xres = resolution;
|
session.params.xres = resolution;
|
||||||
session.params.yres = resolution;
|
session.params.yres = resolution;
|
||||||
|
@ -1096,10 +1099,16 @@ void scanner_move(Genesys_Device& dev, ScanMethod scan_method, unsigned steps, D
|
||||||
scanner_clear_scan_and_feed_counts2(dev);
|
scanner_clear_scan_and_feed_counts2(dev);
|
||||||
|
|
||||||
dev.interface->write_registers(local_reg);
|
dev.interface->write_registers(local_reg);
|
||||||
|
if (uses_secondary_head) {
|
||||||
|
gl843::gl843_set_xpa_motor_power(&dev, local_reg, true);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
scanner_start_action(dev, true);
|
scanner_start_action(dev, true);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
|
catch_all_exceptions(__func__, [&]() {
|
||||||
|
gl843::gl843_set_xpa_motor_power(&dev, local_reg, false);
|
||||||
|
});
|
||||||
catch_all_exceptions(__func__, [&]() { scanner_stop_action(dev); });
|
catch_all_exceptions(__func__, [&]() { scanner_stop_action(dev); });
|
||||||
// restore original registers
|
// restore original registers
|
||||||
catch_all_exceptions(__func__, [&]() { dev.interface->write_registers(dev.reg); });
|
catch_all_exceptions(__func__, [&]() { dev.interface->write_registers(dev.reg); });
|
||||||
|
@ -1112,6 +1121,9 @@ void scanner_move(Genesys_Device& dev, ScanMethod scan_method, unsigned steps, D
|
||||||
if (dev.model->asic_type != AsicType::GL843) {
|
if (dev.model->asic_type != AsicType::GL843) {
|
||||||
scanner_stop_action(dev);
|
scanner_stop_action(dev);
|
||||||
}
|
}
|
||||||
|
if (uses_secondary_head) {
|
||||||
|
gl843::gl843_set_xpa_motor_power(&dev, local_reg, false);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1126,6 +1138,9 @@ void scanner_move(Genesys_Device& dev, ScanMethod scan_method, unsigned steps, D
|
||||||
if (dev.model->asic_type != AsicType::GL843) {
|
if (dev.model->asic_type != AsicType::GL843) {
|
||||||
scanner_stop_action(dev);
|
scanner_stop_action(dev);
|
||||||
}
|
}
|
||||||
|
if (uses_secondary_head) {
|
||||||
|
gl843::gl843_set_xpa_motor_power(&dev, local_reg, false);
|
||||||
|
}
|
||||||
|
|
||||||
// looks like certain scanners lock up if we scan immediately after feeding
|
// looks like certain scanners lock up if we scan immediately after feeding
|
||||||
dev.interface->sleep_ms(100);
|
dev.interface->sleep_ms(100);
|
||||||
|
|
Ładowanie…
Reference in New Issue