mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
[KDCOM]
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:
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user