genesys: Fix infinite loop when we overestimate distance to home sensor

merge-requests/213/head
Povilas Kanapickas 2019-12-14 10:20:27 +02:00
rodzic 01ca9c9030
commit 6fb588648c
1 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -1009,9 +1009,15 @@ void scanner_move(Genesys_Device& dev, ScanMethod scan_method, unsigned steps, D
// wait until feed count reaches the required value
// FIXME: should porbably wait for some timeout
Status status;
do {
for (unsigned i = 0;; ++i) {
status = scanner_read_status(dev);
} while (!status.is_feeding_finished);
if (status.is_feeding_finished || (
direction == Direction::BACKWARD && status.is_at_home))
{
break;
}
dev.interface->sleep_ms(10);
}
// FIXME: why don't we stop the scanner like on other ASICs
if (dev.model->asic_type != AsicType::GL843) {