Skip to content

Commit

Permalink
fixed mobile build
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalkbrenner committed Dec 20, 2024
1 parent fb0f085 commit 2bdeb2d
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/ZeDMDComm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,11 @@ bool ZeDMDComm::Connect(char* pDevice)
return false;
}

bool ZeDMDComm::Handshake(char* pDevice) {
bool ZeDMDComm::Handshake(char* pDevice)
{
#if !( \
(defined(__APPLE__) && ((defined(TARGET_OS_IOS) && TARGET_OS_IOS) || (defined(TARGET_OS_TV) && TARGET_OS_TV))) || \
defined(__ANDROID__))
uint8_t data[8] = {0};

data[0] = ZEDMD_COMM_COMMAND::Handshake;
Expand Down Expand Up @@ -499,6 +503,7 @@ bool ZeDMDComm::Handshake(char* pDevice) {
}
}
}
#endif

return false;
}
Expand Down Expand Up @@ -554,7 +559,7 @@ void ZeDMDComm::Reset()
#endif
}

void ZeDMDComm:: SoftReset()
void ZeDMDComm::SoftReset()
{
QueueCommand(ZEDMD_COMM_COMMAND::Reset);
// Wait a bit to let the reset command be transmitted.
Expand Down Expand Up @@ -667,18 +672,22 @@ bool ZeDMDComm::SendChunks(uint8_t* pData, uint16_t size)
if (response == 'A')
{
if (m_noAcknowledgeCounter > 0) m_noAcknowledgeCounter--;
} else {
if (++m_noAcknowledgeCounter > 64) {
}
else
{
if (++m_noAcknowledgeCounter > 64)
{
SoftReset();
Log("Resetted device", response);
Handshake(m_device);
} else {
}
else
{
Log("Write bytes failure: response=%d", response);
}
return false;
}


return true;
}

Expand Down

0 comments on commit 2bdeb2d

Please sign in to comment.