68,16 → 68,18 |
|
void com_irq_sel(int no) |
{ |
BYTE b; |
BYTE b, v; |
unsigned i; |
|
|
for(i=0;i<4;i++) |
if (com_irq[i] == no) break; |
|
b = DECODE(com_read(i, IIR)); |
while(PENDIRQ(v = com_read(i, IIR))) { |
|
switch (b) |
{ |
b = DECODE(v); |
|
switch (b) |
{ |
case LS_CHANGED: |
LSR_handler(i); |
break; |
89,7 → 91,10 |
case TX_EMPTY: |
THRE_handler(i); |
break; |
} |
|
} |
|
} |
|
void com_irq_enable(unsigned port, unsigned irq) |
191,9 → 196,12 |
|
void THRE_handler (unsigned port) /* Transmit Data Register Ready for next byte */ |
{ |
if (SCom_TX_data[port].ptr < SCom_TX_data[port].len) |
com_write(port, THR, SCom_TX_data[port].buf[SCom_TX_data[port].ptr++]); |
else SCom_Access.confirm(port, COM_OK); |
if (SCom_TX_data[port].ptr < SCom_TX_data[port].len) { |
com_write(port, THR, SCom_TX_data[port].buf[SCom_TX_data[port].ptr++]); |
} else { |
SCom_Access.confirm(port, COM_OK); |
} |
|
} |
|
void RBRF_handler (unsigned port) /* Receive Data Register Full */ |
204,6 → 212,6 |
void LSR_handler (unsigned port) /* break = 8, frame = 4, parity = 2, RBR overrun = 1*/ |
{ |
SCom_Error[port] = (com_read(port, LSR) & (bit4|bit3|bit2|bit1) ) >> 1; |
SCom_Access.confirm(port, COM_ERROR); |
SCom_Access.confirm(port, COM_ERROR); |
} |
|