[Com0com-cvs] com0com/sys bufutils.c,1.9,1.10
The virtual serial port driver for Windows.
Brought to you by:
vfrolov
From: Vyacheslav F. <vf...@us...> - 2007-10-05 07:34:41
|
Update of /cvsroot/com0com/com0com/sys In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv3681 Modified Files: bufutils.c Log Message: Added missing *pOverrun initialization Changed TX FIFO writing emulation to be interrupt driven Index: bufutils.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/bufutils.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** bufutils.c 20 Jul 2007 08:00:22 -0000 1.9 --- bufutils.c 5 Oct 2007 07:34:21 -0000 1.10 *************** *** 20,23 **** --- 20,27 ---- * * $Log$ + * Revision 1.10 2007/10/05 07:34:21 vfrolov + * Added missing *pOverrun initialization + * Changed TX FIFO writing emulation to be interrupt driven + * * Revision 1.9 2007/07/20 08:00:22 vfrolov * Implemented TX buffer *************** *** 317,320 **** --- 321,327 ---- PUCHAR pWriteBuf = (PUCHAR)pWrite; + if (pOverrun) + *pOverrun = 0; + while (writeLength) { SIZE_T readDone, writeDone; *************** *** 334,339 **** pWriteBuf += writeDone; - } else { - *pOverrun = 0; } } --- 341,344 ---- *************** *** 596,602 **** SIZE_T writeLength) { ! PUCHAR pWriteBuf = (PUCHAR)pWrite; ! while (writeLength && pTxBuf->busy < C0C_TX_BUFFER_SIZE(pTxBuf)) { SIZE_T readLength; PUCHAR pReadBuf; --- 601,622 ---- SIZE_T writeLength) { ! PUCHAR pWriteBuf; ! SIZE_T sizeTxBuf; ! /* Writing to TX FIFO is interrupt driven so we can write only if it's empty */ ! ! if (!C0C_TX_BUFFER_THR_EMPTY(pTxBuf)) ! return 0; ! ! sizeTxBuf = C0C_TX_BUFFER_SIZE(pTxBuf); ! ! /* Write not more then TxFIFO registry value */ ! ! if (writeLength > sizeTxBuf - 1) ! writeLength = sizeTxBuf - 1; ! ! pWriteBuf = (PUCHAR)pWrite; ! ! while (writeLength && pTxBuf->busy < sizeTxBuf) { SIZE_T readLength; PUCHAR pReadBuf; *************** *** 683,687 **** UNREFERENCED_PARAMETER(cleanFifo); ! size = 1; size += 1; /* add shift register */ --- 703,707 ---- UNREFERENCED_PARAMETER(cleanFifo); ! size = sizeof(pTxBuf->leastBuf) - 1; size += 1; /* add shift register */ |