Fixed printer IRQ handling, hopefully it now operates correctly.

This commit is contained in:
OBattler
2019-09-22 22:54:05 +02:00
parent 64c4a9946e
commit 747cd99447
2 changed files with 3 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -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);
}