- 论坛徽章:
- 0
|
回复 #1 againyuan 的帖子
找到原因了,串口驱动有问题
修改的地方在while循环中
在串口的状态检测中用while来检测,防止检测一次造成不稳定
if (status & KS8695_INTMASK_UART_TX)
do
{
if (port->x_char) {
UART_CLR_INT_STATUS(port, KS8695_INTMASK_UART_TX);
UART_PUT_CHAR(port, (u_int) port->x_char);
port->icount.tx++;
port->x_char = 0;
break;
}
if ( uart_tx_stopped(port) || uart_circ_empty(xmit)) {
ks8695_uart_stop_tx( port, 1 );
break;
}
count = 16;
do {
UART_CLR_INT_STATUS(port, KS8695_INTMASK_UART_TX);
UART_PUT_CHAR(port, (u_int) (xmit->buf[xmit->tail]));
xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
port->icount.tx++;
if (uart_circ_empty(xmit))
break;
} while (--count > 0);
if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
uart_write_wakeup(port);
}
while ( 0 );
[ 本帖最后由 againyuan 于 2008-3-27 10:25 编辑 ] |
|