For unknown reasons it's not enough to check LSR if the port is ready to receive or not. Adding additional port reads improves the reliability of the data massively. Now it's possible to use kdcom on windows XP!

svn path=/branches/ros-amd64-bringup/; revision=43770
This commit is contained in:
Timo Kreuzer
2009-10-26 03:24:03 +00:00
parent 7be05b3ec6
commit 6b92b26b8e
+7
View File
@@ -216,6 +216,11 @@ KdpSendByte(IN BYTE Byte)
/* Wait for the port to be ready */
while ((READ_PORT_UCHAR(ComPortBase + COM_LSR) & LSR_TBE) == 0);
/* This is needed due to subtle timing issues */
READ_PORT_UCHAR(ComPortBase + COM_MSR);
while ((READ_PORT_UCHAR(ComPortBase + COM_LSR) & LSR_TBE) == 0);
READ_PORT_UCHAR(ComPortBase + COM_MSR);
/* Send the byte */
WRITE_PORT_UCHAR(ComPortBase + COM_DAT, Byte);
}
@@ -224,6 +229,8 @@ KDP_STATUS
NTAPI
KdpPollByte(OUT PBYTE OutByte)
{
READ_PORT_UCHAR(ComPortBase + COM_MSR); // Timing
/* Check if data is available */
if ((READ_PORT_UCHAR(ComPortBase + COM_LSR) & LSR_DR))
{