kopia lustrzana https://gitlab.com/sane-project/backends
genesys: Fix inconsistent check of scanner status in *_stop_action()
rodzic
a90ab552a9
commit
c2863d6ba1
|
@ -1006,12 +1006,12 @@ void gl124_stop_action(Genesys_Device* dev)
|
||||||
unsigned int loop;
|
unsigned int loop;
|
||||||
|
|
||||||
dev->cmd_set->update_home_sensor_gpio(*dev);
|
dev->cmd_set->update_home_sensor_gpio(*dev);
|
||||||
scanner_read_print_status(*dev);
|
auto status = scanner_read_status(*dev);
|
||||||
|
|
||||||
val40 = dev->interface->read_register(REG_0x100);
|
val40 = dev->interface->read_register(REG_0x100);
|
||||||
|
|
||||||
/* only stop action if needed */
|
/* only stop action if needed */
|
||||||
if (!(val40 & REG_0x100_DATAENB) && !(val40 & REG_0x100_MOTMFLG)) {
|
if (!(val40 & REG_0x100_DATAENB) && !(val40 & REG_0x100_MOTMFLG) && !status.is_motor_enabled) {
|
||||||
DBG (DBG_info, "%s: already stopped\n", __func__);
|
DBG (DBG_info, "%s: already stopped\n", __func__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1320,12 +1320,12 @@ void gl843_stop_action(Genesys_Device* dev)
|
||||||
DBG_HELPER(dbg);
|
DBG_HELPER(dbg);
|
||||||
unsigned int loop;
|
unsigned int loop;
|
||||||
|
|
||||||
scanner_read_print_status(*dev);
|
auto status = scanner_read_status(*dev);
|
||||||
|
|
||||||
uint8_t val40 = dev->interface->read_register(REG_0x40);
|
uint8_t val40 = dev->interface->read_register(REG_0x40);
|
||||||
|
|
||||||
/* only stop action if needed */
|
/* only stop action if needed */
|
||||||
if (!(val40 & REG_0x40_DATAENB) && !(val40 & REG_0x40_MOTMFLG))
|
if (!(val40 & REG_0x40_DATAENB) && !(val40 & REG_0x40_MOTMFLG) && !status.is_motor_enabled)
|
||||||
{
|
{
|
||||||
DBG(DBG_info, "%s: already stopped\n", __func__);
|
DBG(DBG_info, "%s: already stopped\n", __func__);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -846,12 +846,12 @@ void gl846_stop_action(Genesys_Device* dev)
|
||||||
unsigned int loop;
|
unsigned int loop;
|
||||||
|
|
||||||
dev->cmd_set->update_home_sensor_gpio(*dev);
|
dev->cmd_set->update_home_sensor_gpio(*dev);
|
||||||
scanner_read_print_status(*dev);
|
auto status = scanner_read_status(*dev);
|
||||||
|
|
||||||
uint8_t val40 = dev->interface->read_register(REG_0x40);
|
uint8_t val40 = dev->interface->read_register(REG_0x40);
|
||||||
|
|
||||||
/* only stop action if needed */
|
/* only stop action if needed */
|
||||||
if (!(val40 & REG_0x40_DATAENB) && !(val40 & REG_0x40_MOTMFLG)) {
|
if (!(val40 & REG_0x40_DATAENB) && !(val40 & REG_0x40_MOTMFLG) && !status.is_motor_enabled) {
|
||||||
DBG(DBG_info, "%s: already stopped\n", __func__);
|
DBG(DBG_info, "%s: already stopped\n", __func__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -850,12 +850,12 @@ void gl847_stop_action(Genesys_Device* dev)
|
||||||
unsigned int loop;
|
unsigned int loop;
|
||||||
|
|
||||||
dev->cmd_set->update_home_sensor_gpio(*dev);
|
dev->cmd_set->update_home_sensor_gpio(*dev);
|
||||||
scanner_read_print_status(*dev);
|
auto status = scanner_read_status(*dev);
|
||||||
|
|
||||||
uint8_t val40 = dev->interface->read_register(REG_0x40);
|
uint8_t val40 = dev->interface->read_register(REG_0x40);
|
||||||
|
|
||||||
/* only stop action if needed */
|
/* only stop action if needed */
|
||||||
if (!(val40 & REG_0x40_DATAENB) && !(val40 & REG_0x40_MOTMFLG)) {
|
if (!(val40 & REG_0x40_DATAENB) && !(val40 & REG_0x40_MOTMFLG) && !status.is_motor_enabled) {
|
||||||
DBG(DBG_info, "%s: already stopped\n", __func__);
|
DBG(DBG_info, "%s: already stopped\n", __func__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue