From aee82ba0b729a4ba6e64912435639cc8be49c200 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Sun, 4 Dec 2011 20:02:06 +0100 Subject: [PATCH] cec: don't block when clearing input and no data is received --- src/lib/AdapterCommunication.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/AdapterCommunication.cpp b/src/lib/AdapterCommunication.cpp index 6cc482f..df803f5 100644 --- a/src/lib/AdapterCommunication.cpp +++ b/src/lib/AdapterCommunication.cpp @@ -289,8 +289,8 @@ bool CAdapterCommunication::Open(const char *strPort, uint16_t iBaudRate /* = 38 m_processor->AddLog(CEC_LOG_DEBUG, "connection opened"); //clear any input bytes - uint8_t buff[1024]; - while (m_port->Read(buff, sizeof(buff), 1000) > 0) {} + uint8_t buff[1]; + while (m_port->Read(buff, 1, 5) == 1) {} if (CreateThread()) { -- 2.34.1