Skip to content

Commit 4c2b86f

Browse files
committed
qt: fixed read/write timeouts
1 parent 2034934 commit 4c2b86f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

qt/programmer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
#define CDC_DEV_NAME "/dev/ttyACM0"
1010
#define CDC_BUF_SIZE 60
1111

12-
#define READ_WRITE_TIMEOUT_MS 30000
12+
#define READ_WRITE_TIMEOUT_MS 10
13+
#define READ_RESP_TIMEOUT_MS 30000
1314

1415
Programmer::Programmer(QObject *parent) : QObject(parent)
1516
{
@@ -81,7 +82,7 @@ int Programmer::readRespHead(RespHeader *respHead)
8182
{
8283
qint64 ret;
8384

84-
serialPort.waitForReadyRead(READ_WRITE_TIMEOUT_MS);
85+
serialPort.waitForReadyRead(READ_RESP_TIMEOUT_MS);
8586
ret = serialPort.read((char *)respHead, sizeof(RespHeader));
8687
if (ret < 0)
8788
{

0 commit comments

Comments
 (0)