Revert "pixma_mp150.c: replace multiple if statements with case statement in handle_interrupt"

This reverts commit 28dcd0aef4.
merge-requests/1/head
Louis Lagendijk 2017-01-06 23:28:31 +01:00
rodzic 06b4b27ecf
commit 6c439bce79
1 zmienionych plików z 35 dodań i 41 usunięć

Wyświetl plik

@ -956,47 +956,41 @@ handle_interrupt (pixma_t * s, int timeout)
* tt: target * tt: target
* rr: scan resolution * rr: scan resolution
* poll event with 'scanimage -A' */ * poll event with 'scanimage -A' */
switch (s->cfg->pid) if (s->cfg->pid == MG6200_PID
{ || s->cfg->pid == MG6300_PID
case MG6200_PID: || s->cfg->pid == MX520_PID
case MG6300_PID: || s->cfg->pid == MX720_PID
case MX520_PID: || s->cfg->pid == MX920_PID
case MX720_PID: || s->cfg->pid == MB5000_PID)
case MX920_PID: /* button no. in buf[7]
case MB5000_PID: * size in buf[10] 01=A4; 02=Letter; 08=10x15; 09=13x18; 0b=auto
* format in buf[11] 01=JPEG; 02=TIFF; 03=PDF; 04=Kompakt-PDF
/* button no. in buf[7] * dpi in buf[12] 01=75; 02=150; 03=300; 04=600
* size in buf[10] 01=A4; 02=Letter; 08=10x15; 09=13x18; 0b=auto * target = format; original = size; scan-resolution = dpi */
* format in buf[11] 01=JPEG; 02=TIFF; 03=PDF; 04=Kompakt-PDF {
* dpi in buf[12] 01=75; 02=150; 03=300; 04=600 if (buf[7] & 1)
* target = format; original = size; scan-resolution = dpi */ s->events = PIXMA_EV_BUTTON1 | buf[11] | buf[10]<<8 | buf[12]<<16; /* color scan */
if (buf[7] & 2)
if (buf[7] & 1) s->events = PIXMA_EV_BUTTON2 | buf[11] | buf[10]<<8 | buf[12]<<16; /* b/w scan */
s->events = PIXMA_EV_BUTTON1 | buf[11] | buf[10]<<8 | buf[12]<<16; /* color scan */ }
if (buf[7] & 2) else
s->events = PIXMA_EV_BUTTON2 | buf[11] | buf[10]<<8 | buf[12]<<16; /* b/w scan */ /* button no. in buf[0]
break; * original in buf[0]
* target in buf[1] */
default: {
/* More than one event can be reported at the same time. */
/* button no. in buf[0] if (buf[3] & 1)
* original in buf[0] /* FIXME: This function makes trouble with a lot of scanners
* target in buf[1] */ send_time (s);
*/
/* More than one event can be reported at the same time. */ PDBG (pixma_dbg (1, "WARNING:send_time() disabled!\n"));
if (buf[3] & 1) if (buf[9] & 2)
/* FIXME: This function makes trouble with a lot of scanners query_status (s);
send_time (s); if (buf[0] & 2)
*/ s->events = PIXMA_EV_BUTTON2 | buf[1] | ((buf[0] & 0xf0) << 4); /* b/w scan */
PDBG (pixma_dbg (1, "WARNING:send_time() disabled!\n")); if (buf[0] & 1)
if (buf[9] & 2) s->events = PIXMA_EV_BUTTON1 | buf[1] | ((buf[0] & 0xf0) << 4); /* color scan */
query_status (s); }
if (buf[0] & 2)
s->events = PIXMA_EV_BUTTON2 | buf[1] | ((buf[0] & 0xf0) << 4); /* b/w scan */
if (buf[0] & 1)
s->events = PIXMA_EV_BUTTON1 | buf[1] | ((buf[0] & 0xf0) << 4); /* color scan */
break;
}
return 1; return 1;
} }