genesys: Add model option to disable fast feeding

merge-requests/244/head
Povilas Kanapickas 2020-06-27 00:47:17 +03:00
rodzic 86c15ff4a0
commit 02782651a3
6 zmienionych plików z 22 dodań i 0 usunięć

Wyświetl plik

@ -519,6 +519,9 @@ enum class ModelFlag : unsigned
// allow custom gamma tables
CUSTOM_GAMMA = 1 << 13,
// disable fast feeding mode on this scanner
DISABLE_FAST_FEEDING = 1 << 14,
// the scanner uses multi-segment sensors that must be handled during calibration
SIS_SENSOR = 1 << 16,

Wyświetl plik

@ -575,6 +575,9 @@ static void gl841_init_motor_regs_feed(Genesys_Device* dev, const Genesys_Sensor
// BUG: fast table is counted in base_ydpi / 4
feedl = feed_steps - fast_table.table.size() * 2;
use_fast_fed = 1;
if (has_flag(dev->model->flags, ModelFlag::DISABLE_FAST_FEEDING)) {
use_fast_fed = false;
}
reg->set8(0x3d, (feedl >> 16) & 0xf);
reg->set8(0x3e, (feedl >> 8) & 0xff);
@ -713,6 +716,10 @@ static void gl841_init_motor_regs_scan(Genesys_Device* dev, const Genesys_Sensor
use_fast_fed = fast_time < slow_time;
}
if (has_flag(dev->model->flags, ModelFlag::DISABLE_FAST_FEEDING)) {
use_fast_fed = false;
}
if (use_fast_fed) {
feedl = feed_steps - fast_table.table.size() * 2 -
(slow_table.table.size() >> static_cast<unsigned>(motor_profile.step_type));

Wyświetl plik

@ -256,6 +256,9 @@ static void gl842_init_motor_regs_scan(Genesys_Device* dev,
if ((scan_yres >= 300 && feed_steps > 900) || (has_flag(flags, ScanFlag::FEEDING))) {
use_fast_fed = true;
}
if (has_flag(dev->model->flags, ModelFlag::DISABLE_FAST_FEEDING)) {
use_fast_fed = false;
}
reg->set24(REG_LINCNT, scan_lines);

Wyświetl plik

@ -710,6 +710,9 @@ static void gl843_init_motor_regs_scan(Genesys_Device* dev,
if ((scan_yres >= 300 && feed_steps > 900) || (has_flag(flags, ScanFlag::FEEDING))) {
use_fast_fed = true;
}
if (has_flag(dev->model->flags, ModelFlag::DISABLE_FAST_FEEDING)) {
use_fast_fed = false;
}
reg->set24(REG_LINCNT, scan_lines);

Wyświetl plik

@ -380,6 +380,9 @@ static void gl846_init_motor_regs_scan(Genesys_Device* dev,
if (dev->settings.yres == 4444 && feed_steps > 100 && !has_flag(flags, ScanFlag::FEEDING)) {
use_fast_fed = true;
}
if (has_flag(dev->model->flags, ModelFlag::DISABLE_FAST_FEEDING)) {
use_fast_fed = false;
}
reg->set24(REG_LINCNT, scan_lines);

Wyświetl plik

@ -344,6 +344,9 @@ static void gl847_init_motor_regs_scan(Genesys_Device* dev,
if (dev->settings.yres == 4444 && feed_steps > 100 && !has_flag(flags, ScanFlag::FEEDING)) {
use_fast_fed = true;
}
if (has_flag(dev->model->flags, ModelFlag::DISABLE_FAST_FEEDING)) {
use_fast_fed = false;
}
reg->set24(REG_LINCNT, scan_lines);