Skip to content

Commit

Permalink
fixed UART?
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalkbrenner committed Jan 28, 2025
1 parent b309ae3 commit a88f104
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/ZeDMDComm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,12 +701,26 @@ bool ZeDMDComm::SendChunks(uint8_t* pData, uint16_t size)
uint8_t* padded = (uint8_t*)malloc(m_writeAtOnce);
memset(padded, 0, m_writeAtOnce);
memcpy(padded, &pData[sent], toSend);
status = sp_blocking_write(m_pSerialPort, padded, m_writeAtOnce, ZEDMD_COMM_SERIAL_WRITE_TIMEOUT);
if (m_cdc)
{
status = sp_blocking_write(m_pSerialPort, padded, m_writeAtOnce, ZEDMD_COMM_SERIAL_WRITE_TIMEOUT);
}
else
{
status = sp_nonblocking_write(m_pSerialPort, padded, m_writeAtOnce);
}
free(padded);
}
else
{
status = sp_blocking_write(m_pSerialPort, &pData[sent], toSend, ZEDMD_COMM_SERIAL_WRITE_TIMEOUT);
if (m_cdc)
{
status = sp_blocking_write(m_pSerialPort, &pData[sent], toSend, ZEDMD_COMM_SERIAL_WRITE_TIMEOUT);
}
else
{
status = sp_nonblocking_write(m_pSerialPort, &pData[sent], toSend);
}
}

if (status < toSend)
Expand Down

0 comments on commit a88f104

Please sign in to comment.