Skip to content

Commit d9ef6f7

Browse files
committed
64 bytes USB handshake
1 parent f2ea137 commit d9ef6f7

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/ZeDMDComm.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -499,15 +499,13 @@ bool ZeDMDComm::Handshake(char* pDevice)
499499
sp_blocking_write(m_pSerialPort, data, ZEDMD_COMM_MAX_SERIAL_WRITE_AT_ONCE, ZEDMD_COMM_SERIAL_WRITE_TIMEOUT);
500500
if (result == ZEDMD_COMM_MAX_SERIAL_WRITE_AT_ONCE)
501501
{
502-
// For Linux and macOS, 200ms seem to be sufficient. But some Windows installations require a longer sleep here for
503-
// the S3.
504-
std::this_thread::sleep_for(std::chrono::milliseconds(m_s3 ? 500 : 200));
502+
std::this_thread::sleep_for(std::chrono::milliseconds(200));
505503
memset(data, 0, ZEDMD_COMM_MAX_SERIAL_WRITE_AT_ONCE);
506-
result = sp_blocking_read(m_pSerialPort, data, 20, 200);
504+
result = sp_blocking_read(m_pSerialPort, data, 64, 500);
507505

508-
if (result == 20 && memcmp(data, CTRL_CHARS_HEADER, 4) == 0)
506+
if (result == 64 && memcmp(data, CTRL_CHARS_HEADER, 4) == 0)
509507
{
510-
if (data[13] == 'R')
508+
if (data[57] == 'R')
511509
{
512510
m_width = data[4] + data[5] * 256;
513511
m_height = data[6] + data[7] * 256;

0 commit comments

Comments
 (0)