Fixed printer IRQ handling, hopefully it now operates correctly.
This commit is contained in:
@@ -519,6 +519,7 @@ static void
|
||||
reset_printer_hard(escp_t *dev)
|
||||
{
|
||||
dev->char_read = 0;
|
||||
lpt_irq(dev->lpt, 1);
|
||||
timer_disable(&dev->timeout_timer);
|
||||
reset_printer(dev);
|
||||
}
|
||||
@@ -1590,7 +1591,6 @@ handle_char(escp_t *dev, uint8_t ch)
|
||||
double x_advance;
|
||||
|
||||
dev->char_read = 1;
|
||||
lpt_irq(dev->lpt, 1);
|
||||
|
||||
if (dev->page == NULL)
|
||||
return;
|
||||
@@ -1762,6 +1762,7 @@ print_ack(escp_t *dev)
|
||||
{
|
||||
if (dev->char_read) {
|
||||
dev->char_read = 0;
|
||||
lpt_irq(dev->lpt, 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@@ -394,7 +394,6 @@ write_ctrl(uint8_t val, void *priv)
|
||||
|
||||
/* ACK it, will be read on next READ STATUS. */
|
||||
dev->ack = 1;
|
||||
lpt_irq(dev->lpt, 1);
|
||||
|
||||
timer_set_delay_u64(&dev->timeout_timer, 500000 * TIMER_USEC);
|
||||
}
|
||||
@@ -419,6 +418,7 @@ read_status(void *priv)
|
||||
|
||||
/* Clear ACK after reading status. */
|
||||
dev->ack = 0;
|
||||
lpt_irq(dev->lpt, 1);
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
Reference in New Issue
Block a user