ES1371 MIDI UART transmit interrupt enable bit is now actually honored.

This commit is contained in:
OBattler
2021-12-03 00:37:30 +01:00
parent 28be6f99d1
commit d3efb6998b

View File

@@ -158,7 +158,7 @@ typedef struct {
#define INT_STATUS_DAC2 (1<<1)
#define UART_CTRL_RXINTEN (1<<7)
#define UART_CTRL_TXINTEN (1<<5)
#define UART_CTRL_TXINTEN (3<<5)
#define UART_STATUS_RXINT (1<<7)
#define UART_STATUS_TXINT (1<<2)
@@ -206,7 +206,8 @@ es1371_update_irqs(es1371_t *dev)
irq = 1;
/* MIDI input is unsupported for now */
if ((dev->int_status & INT_STATUS_UART) && (dev->uart_status & UART_STATUS_TXINT))
if ((dev->int_status & INT_STATUS_UART) && (dev->uart_status & UART_STATUS_TXINT) &&
((dev->uart_ctrl & UART_CTRL_TXINTEN) != 0x20))
irq = 1;
if (irq)
@@ -786,6 +787,9 @@ es1371_outb(uint16_t port, uint8_t val, void *p)
Addressable as byte only */
case 0x09:
dev->uart_ctrl = val & 0xe3;
if ((dev->uart_ctrl & UART_CTRL_TXINTEN) != 0x20)
dev->int_status &= ~INT_STATUS_UART;
es1371_update_irqs(dev);
audiopci_log("ES1371 UART Cntrl = %02x\n", dev->uart_ctrl);
break;