From f0a22e171e0254dd4e3fc0c5b55022aeb958f387 Mon Sep 17 00:00:00 2001 From: Markus Kalkbrenner Date: Thu, 19 Dec 2024 12:31:08 +0100 Subject: [PATCH] fixed HD memory issues --- src/ZeDMD.cpp | 75 ++++++++++++++++------------------------------- src/ZeDMD.h | 7 ++--- src/ZeDMDComm.cpp | 43 +++++++-------------------- src/ZeDMDComm.h | 31 +++++++++----------- src/ZeDMDWiFi.cpp | 12 ++++++-- src/ZeDMDWiFi.h | 3 +- 6 files changed, 63 insertions(+), 108 deletions(-) diff --git a/src/ZeDMD.cpp b/src/ZeDMD.cpp index 6efc79e..f2ecad6 100644 --- a/src/ZeDMD.cpp +++ b/src/ZeDMD.cpp @@ -16,7 +16,6 @@ ZeDMD::ZeDMD() m_pFrameBuffer = nullptr; m_pScaledFrameBuffer = nullptr; - m_pCommandBuffer = nullptr; m_pRgb565Buffer = nullptr; m_pZeDMDComm = new ZeDMDComm(); @@ -38,11 +37,6 @@ ZeDMD::~ZeDMD() delete m_pScaledFrameBuffer; } - if (m_pCommandBuffer) - { - delete m_pCommandBuffer; - } - if (m_pRgb565Buffer) { delete m_pRgb565Buffer; @@ -264,11 +258,13 @@ bool ZeDMD::OpenWiFi(const char* ip, int port) if (m_wifi && !m_usb) { + uint16_t width = m_pZeDMDWiFi->GetWidth(); + uint16_t height = m_pZeDMDWiFi->GetHeight(); + m_hd = (width == 256); + m_pFrameBuffer = (uint8_t*)malloc(ZEDMD_MAX_WIDTH * ZEDMD_MAX_HEIGHT * 3); m_pScaledFrameBuffer = (uint8_t*)malloc(ZEDMD_MAX_WIDTH * ZEDMD_MAX_HEIGHT * 3); - m_pRgb565Buffer = (uint8_t*)malloc(ZEDMD_MAX_WIDTH * ZEDMD_MAX_HEIGHT); - - m_hd = (m_pZeDMDWiFi->GetWidth() == 256); + m_pRgb565Buffer = (uint8_t*)malloc(width * height * 2); m_pZeDMDWiFi->Run(); } @@ -284,12 +280,13 @@ bool ZeDMD::Open() if (m_usb && !m_wifi) { + uint16_t width = m_pZeDMDComm->GetWidth(); + uint16_t height = m_pZeDMDComm->GetHeight(); + m_hd = (width == 256); + m_pFrameBuffer = (uint8_t*)malloc(ZEDMD_MAX_WIDTH * ZEDMD_MAX_HEIGHT * 3); m_pScaledFrameBuffer = (uint8_t*)malloc(ZEDMD_MAX_WIDTH * ZEDMD_MAX_HEIGHT * 3); - m_pCommandBuffer = (uint8_t*)malloc(ZEDMD_MAX_WIDTH * ZEDMD_MAX_HEIGHT * 3 + 192); - m_pRgb565Buffer = (uint8_t*)malloc(ZEDMD_MAX_WIDTH * ZEDMD_MAX_HEIGHT); - - m_hd = (m_pZeDMDComm->GetWidth() == 256); + m_pRgb565Buffer = (uint8_t*)malloc(width * height * 2); m_pZeDMDComm->Run(); } @@ -328,10 +325,7 @@ void ZeDMD::RenderRgb888(uint8_t* pFrame) return; } - uint16_t width; - uint16_t height; - - int bufferSize = Scale888(m_pScaledFrameBuffer, m_pFrameBuffer, 3, &width, &height); + int bufferSize = Scale888(m_pScaledFrameBuffer, m_pFrameBuffer, 3); int rgb565Size = bufferSize / 3; for (uint16_t i = 0; i < rgb565Size; i++) { @@ -343,11 +337,11 @@ void ZeDMD::RenderRgb888(uint8_t* pFrame) if (m_wifi) { - m_pZeDMDWiFi->QueueCommand(ZEDMD_COMM_COMMAND::RGB565ZonesStream, m_pRgb565Buffer, rgb565Size * 2, width, height); + m_pZeDMDWiFi->QueueFrame(m_pRgb565Buffer, rgb565Size * 2); } else if (m_usb) { - m_pZeDMDComm->QueueCommand(ZEDMD_COMM_COMMAND::RGB565ZonesStream, m_pRgb565Buffer, rgb565Size * 2, width, height); + m_pZeDMDComm->QueueFrame(m_pRgb565Buffer, rgb565Size * 2); } } @@ -358,18 +352,15 @@ void ZeDMD::RenderRgb565(uint16_t* pFrame) return; } - uint16_t width; - uint16_t height; - - int rgb565Size = Scale565(m_pScaledFrameBuffer, pFrame, &width, &height, is_bigendian()); + int size = Scale565(m_pScaledFrameBuffer, pFrame, is_bigendian()); if (m_wifi) { - m_pZeDMDWiFi->QueueCommand(ZEDMD_COMM_COMMAND::RGB565ZonesStream, m_pScaledFrameBuffer, rgb565Size, width, height); + m_pZeDMDWiFi->QueueFrame(m_pScaledFrameBuffer, size); } else if (m_usb) { - m_pZeDMDComm->QueueCommand(ZEDMD_COMM_COMMAND::RGB565ZonesStream, m_pScaledFrameBuffer, rgb565Size, width, height); + m_pZeDMDComm->QueueFrame(m_pScaledFrameBuffer, size); } } bool ZeDMD::UpdateFrameBuffer888(uint8_t* pFrame) @@ -394,64 +385,48 @@ bool ZeDMD::UpdateFrameBuffer565(uint16_t* pFrame) return true; } -uint8_t ZeDMD::GetScaleMode(uint16_t frameWidth, uint16_t frameHeight, uint16_t* pWidth, uint16_t* pHeight, +uint8_t ZeDMD::GetScaleMode(uint16_t frameWidth, uint16_t frameHeight, uint8_t* pXOffset, uint8_t* pYOffset) { if (m_upscaling && m_romWidth == 192 && frameWidth == 256) { - (*pWidth) = frameWidth; - (*pHeight) = frameHeight; (*pXOffset) = 32; return 0; } else if (m_downscaling && m_romWidth == 192 && frameWidth == 128) { - (*pWidth) = frameWidth; - (*pHeight) = frameHeight; (*pXOffset) = 16; return 1; } else if (m_upscaling && m_romHeight == 16 && frameHeight == 32) { - (*pWidth) = frameWidth; - (*pHeight) = frameHeight; (*pYOffset) = 8; return 0; } else if (m_upscaling && m_romHeight == 16 && frameHeight == 64) { - (*pWidth) = frameWidth; - (*pHeight) = frameHeight; (*pYOffset) = 16; return 2; } else if (m_downscaling && m_romWidth == 256 && frameWidth == 128) { - (*pWidth) = frameWidth; - (*pHeight) = frameHeight; return 1; } else if (m_upscaling && m_romWidth == 128 && frameWidth == 256) { - (*pWidth) = frameWidth; - (*pHeight) = frameHeight; return 2; } else if (!m_upscaling && m_romWidth == 128 && frameWidth == 256) { - (*pWidth) = frameWidth; - (*pHeight) = frameHeight; (*pXOffset) = 64; (*pYOffset) = 16; return 0; } - (*pWidth) = m_romWidth; - (*pHeight) = m_romHeight; return 255; } -int ZeDMD::Scale888(uint8_t* pScaledFrame, uint8_t* pFrame, uint8_t bytes, uint16_t* width, uint16_t* height) +int ZeDMD::Scale888(uint8_t* pScaledFrame, uint8_t* pFrame, uint8_t bytes) { uint8_t bits = bytes * 8; uint8_t xoffset = 0; @@ -459,7 +434,7 @@ int ZeDMD::Scale888(uint8_t* pScaledFrame, uint8_t* pFrame, uint8_t bytes, uint1 uint16_t frameWidth = GetWidth(); uint16_t frameHeight = GetHeight(); int bufferSize = m_romWidth * m_romHeight * bytes; - uint8_t scale = GetScaleMode(frameWidth, frameHeight, width, height, &xoffset, &yoffset); + uint8_t scale = GetScaleMode(frameWidth, frameHeight, &xoffset, &yoffset); if (scale == 255) { @@ -472,28 +447,28 @@ int ZeDMD::Scale888(uint8_t* pScaledFrame, uint8_t* pFrame, uint8_t bytes, uint1 if (scale == 1) { - FrameUtil::Helper::ScaleDown(pScaledFrame, *width, *height, pFrame, m_romWidth, m_romHeight, bits); + FrameUtil::Helper::ScaleDown(pScaledFrame, frameWidth, frameHeight, pFrame, m_romWidth, m_romHeight, bits); } else if (scale == 2) { FrameUtil::Helper::ScaleUp(pScaledFrame, pFrame, m_romWidth, m_romHeight, bits); - if (*width > (m_romWidth * 2) || *height > (m_romHeight * 2)) + if (frameWidth > (m_romWidth * 2) || frameHeight > (m_romHeight * 2)) { uint8_t* pUncenteredFrame = (uint8_t*)malloc(bufferSize); memcpy(pUncenteredFrame, pScaledFrame, bufferSize); - FrameUtil::Helper::Center(pScaledFrame, *width, *height, pUncenteredFrame, m_romWidth * 2, m_romHeight * 2, bits); + FrameUtil::Helper::Center(pScaledFrame, frameWidth, frameHeight, pUncenteredFrame, m_romWidth * 2, m_romHeight * 2, bits); free(pUncenteredFrame); } } else { - FrameUtil::Helper::Center(pScaledFrame, *width, *height, pFrame, m_romWidth, m_romHeight, bits); + FrameUtil::Helper::Center(pScaledFrame, frameWidth, frameHeight, pFrame, m_romWidth, m_romHeight, bits); } return bufferSize; } -int ZeDMD::Scale565(uint8_t* pScaledFrame, uint16_t* pFrame, uint16_t* width, uint16_t* height, bool bigEndian) +int ZeDMD::Scale565(uint8_t* pScaledFrame, uint16_t* pFrame, bool bigEndian) { int bufferSize = m_romWidth * m_romHeight; uint8_t* pConvertedFrame = (uint8_t*)malloc(bufferSize * 2); @@ -503,7 +478,7 @@ int ZeDMD::Scale565(uint8_t* pScaledFrame, uint16_t* pFrame, uint16_t* width, ui pConvertedFrame[i * 2 + bigEndian] = pFrame[i] & 0xFF; } - bufferSize = Scale888(pScaledFrame, pConvertedFrame, 2, width, height); + bufferSize = Scale888(pScaledFrame, pConvertedFrame, 2); free(pConvertedFrame); return bufferSize; diff --git a/src/ZeDMD.h b/src/ZeDMD.h index 8739f16..44dd7d5 100644 --- a/src/ZeDMD.h +++ b/src/ZeDMD.h @@ -332,10 +332,10 @@ class ZEDMDAPI ZeDMD private: bool UpdateFrameBuffer888(uint8_t* pFrame); bool UpdateFrameBuffer565(uint16_t* pFrame); - uint8_t GetScaleMode(uint16_t frameWidth, uint16_t frameHeight, uint16_t* pWidth, uint16_t* pHeight, + uint8_t GetScaleMode(uint16_t frameWidth, uint16_t frameHeight, uint8_t* pXOffset, uint8_t* pYOffset); - int Scale888(uint8_t* pScaledFrame, uint8_t* pFrame, uint8_t bytes, uint16_t* width, uint16_t* height); - int Scale565(uint8_t* pScaledFrame, uint16_t* pFrame, uint16_t* width, uint16_t* height, bool bigEndian); + int Scale888(uint8_t* pScaledFrame, uint8_t* pFrame, uint8_t bytes); + int Scale565(uint8_t* pScaledFrame, uint16_t* pFrame, bool bigEndian); ZeDMDComm* m_pZeDMDComm; ZeDMDWiFi* m_pZeDMDWiFi; @@ -351,7 +351,6 @@ class ZEDMDAPI ZeDMD uint8_t* m_pFrameBuffer; uint8_t* m_pScaledFrameBuffer; - uint8_t* m_pCommandBuffer; uint8_t* m_pRgb565Buffer; }; diff --git a/src/ZeDMDComm.cpp b/src/ZeDMDComm.cpp index 379dec4..957ad7c 100644 --- a/src/ZeDMDComm.cpp +++ b/src/ZeDMDComm.cpp @@ -84,7 +84,8 @@ void ZeDMDComm::Run() if (m_frames.front().data.empty()) { // In case of a simple command, add metadata to indicate that the payload data size is 0. - m_frames.front().data.emplace_back(nullptr, 0, 0); + m_frames.front().data.emplace_back(nullptr, 0); + } bool success = StreamBytes(&(m_frames.front())); m_frames.pop(); @@ -136,7 +137,7 @@ void ZeDMDComm::QueueCommand(char command, uint8_t value) { QueueCommand(command void ZeDMDComm::QueueCommand(char command) { QueueCommand(command, nullptr, 0); } -void ZeDMDComm::QueueCommand(char command, uint8_t* data, int size, uint16_t width, uint16_t height) +void ZeDMDComm::QueueFrame(uint8_t* data, int size) { if (memcmp(data, m_allBlack, size) == 0) { @@ -172,28 +173,15 @@ void ZeDMDComm::QueueCommand(char command, uint8_t* data, int size, uint16_t wid } uint8_t idx = 0; - uint8_t numZones = 0; - uint16_t zonesBytesLimit = 0; + uint16_t zonesBytesLimit = ZEDMD_ZONES_BYTE_LIMIT; const uint16_t zoneBytes = m_zoneWidth * m_zoneHeight * 2; const uint16_t zoneBytesTotal = zoneBytes + 1; uint8_t* zone = (uint8_t*)malloc(zoneBytes); - - if (m_zonesBytesLimit) - { - // Find the limit as integer that is closest to m_zonesBytesLimit for example 1540 for RGB888 HD. - uint8_t zones = m_zonesBytesLimit / zoneBytesTotal; - zonesBytesLimit = zones * zoneBytesTotal; - } - else - { - // For USB UART send one row (16 zones). - zonesBytesLimit = width * m_zoneHeight * 2 + 16; - } uint8_t* buffer = (uint8_t*)malloc(zonesBytesLimit); uint16_t bufferPosition = 0; const uint16_t bufferSizeThreshold = zonesBytesLimit - zoneBytesTotal; - ZeDMDFrame frame(command); + ZeDMDFrame frame(ZEDMD_COMM_COMMAND::RGB565ZonesStream); bool delayed = FillDelayed(); if (delayed) @@ -204,13 +192,13 @@ void ZeDMDComm::QueueCommand(char command, uint8_t* data, int size, uint16_t wid } memset(buffer, 0, zonesBytesLimit); - for (uint16_t y = 0; y < height; y += m_zoneHeight) + for (uint16_t y = 0; y < m_height; y += m_zoneHeight) { - for (uint16_t x = 0; x < width; x += m_zoneWidth) + for (uint16_t x = 0; x < m_width; x += m_zoneWidth) { for (uint8_t z = 0; z < m_zoneHeight; z++) { - memcpy(&zone[z * m_zoneWidth * 2], &data[((y + z) * width + x) * 2], m_zoneWidth * 2); + memcpy(&zone[z * m_zoneWidth * 2], &data[((y + z) * m_width + x) * 2], m_zoneWidth * 2); } bool black = (memcmp(zone, m_allBlack, zoneBytes) == 0); @@ -221,7 +209,6 @@ void ZeDMDComm::QueueCommand(char command, uint8_t* data, int size, uint16_t wid { m_zoneHashes[idx] = hash; m_zoneRepeatCounters[idx] = 0; - numZones++; if (black) { @@ -237,10 +224,9 @@ void ZeDMDComm::QueueCommand(char command, uint8_t* data, int size, uint16_t wid if (bufferPosition > bufferSizeThreshold) { - frame.data.emplace_back(buffer, bufferPosition, numZones); + frame.data.emplace_back(buffer, bufferPosition); memset(buffer, 0, zonesBytesLimit); bufferPosition = 0; - numZones = 0; } } idx++; @@ -249,7 +235,7 @@ void ZeDMDComm::QueueCommand(char command, uint8_t* data, int size, uint16_t wid if (bufferPosition > 0) { - frame.data.emplace_back(buffer, bufferPosition, numZones); + frame.data.emplace_back(buffer, bufferPosition); } free(buffer); @@ -506,10 +492,6 @@ bool ZeDMDComm::Connect(char* pDevice) { // Store the device name for reconnects. SetDevice(pDevice); - m_noReadySignalCounter = 0; - m_flowControlCounter = 1; - if (m_cdc) m_zonesBytesLimit = m_width * m_height * 3 + 128; - Log("ZeDMD found: %sdevice=%s, width=%d, height=%d", m_s3 ? "S3 " : "", pDevice, m_width, m_height); return true; @@ -612,9 +594,7 @@ bool ZeDMDComm::StreamBytes(ZeDMDFrame* pFrame) pData[CTRL_CHARS_HEADER_SIZE + 1] = (uint8_t)(compressedSize >> 8 & 0xFF); pData[CTRL_CHARS_HEADER_SIZE + 2] = (uint8_t)(compressedSize & 0xFF); if ((0 == pData[CTRL_CHARS_HEADER_SIZE + 1] && 0 == pData[CTRL_CHARS_HEADER_SIZE + 2]) || - // The not compressed RGB565 frame is m_width * m_height * 2, but if every pixel is different, we might be - // bigger. - compressedSize > (m_width * m_height * 3)) + compressedSize > (ZEDMD_ZONES_BYTE_LIMIT)) { Log("Compression error"); free(pData); @@ -632,7 +612,6 @@ bool ZeDMDComm::StreamBytes(ZeDMDFrame* pFrame) { int position = 0; success = true; - m_noReadySignalCounter = 0; const uint16_t writeAtOnce = m_s3 ? ZEDMD_S3_COMM_MAX_SERIAL_WRITE_AT_ONCE : ZEDMD_COMM_MAX_SERIAL_WRITE_AT_ONCE; while (position < size && success) diff --git a/src/ZeDMDComm.h b/src/ZeDMDComm.h index 885bef6..16f9e0d 100644 --- a/src/ZeDMDComm.h +++ b/src/ZeDMDComm.h @@ -47,6 +47,11 @@ #define ZEDMD_ZONES_REPEAT_THRESHOLD 30 +// Typically, the MTU is 1480 (1500 - 20 byte header). +// 1460 is safe. For UART or USB CDC we use the same limit since the ZeDMD firmware is unified. + // For USB UART 128x32 send one row (16 zones). +#define ZEDMD_ZONES_BYTE_LIMIT (128 * 4 * 2 + 16) + typedef enum { FrameSize = 0x02, @@ -77,14 +82,13 @@ struct ZeDMDFrameData { uint8_t* data; int size; - uint8_t numZones; // Default constructor - ZeDMDFrameData(int sz = 0) : size(sz), data((sz > 0) ? new uint8_t[sz] : nullptr), numZones(0) {} + ZeDMDFrameData(int sz = 0) : size(sz), data((sz > 0) ? new uint8_t[sz] : nullptr) {} // Constructor to copy data - ZeDMDFrameData(uint8_t* d, int sz = 0, uint8_t nz = 0) - : size(sz), data((sz > 0) ? new uint8_t[sz] : nullptr), numZones(nz) + ZeDMDFrameData(uint8_t* d, int sz = 0) + : size(sz), data((sz > 0) ? new uint8_t[sz] : nullptr) { if (sz > 0) memcpy(data, d, sz); } @@ -94,7 +98,7 @@ struct ZeDMDFrameData // Copy constructor (deep copy) ZeDMDFrameData(const ZeDMDFrameData& other) - : size(other.size), data((other.size > 0) ? new uint8_t[other.size] : nullptr), numZones(other.numZones) + : size(other.size), data((other.size > 0) ? new uint8_t[other.size] : nullptr) { if (other.size > 0) memcpy(data, other.data, other.size); } @@ -108,17 +112,15 @@ struct ZeDMDFrameData size = other.size; data = (other.size > 0) ? new uint8_t[other.size] : nullptr; if (other.size > 0) memcpy(data, other.data, other.size); - numZones = other.numZones; } return *this; } // Move constructor - ZeDMDFrameData(ZeDMDFrameData&& other) noexcept : size(other.size), data(other.data), numZones(other.numZones) + ZeDMDFrameData(ZeDMDFrameData&& other) noexcept : size(other.size), data(other.data) { other.size = 0; other.data = nullptr; - other.numZones = 0; } // Move assignment operator @@ -130,11 +132,9 @@ struct ZeDMDFrameData size = other.size; data = other.data; - numZones = other.numZones; other.size = 0; other.data = nullptr; - other.numZones = 0; } return *this; @@ -150,9 +150,9 @@ struct ZeDMDFrame ZeDMDFrame(uint8_t cmd) : command(cmd) {} // Constructor to add initial data - ZeDMDFrame(uint8_t cmd, uint8_t* d, int s, uint8_t nz = 0) : command(cmd) + ZeDMDFrame(uint8_t cmd, uint8_t* d, int s) : command(cmd) { - data.emplace_back(d, s, nz); // Create and move a new ZeDMDFrameData object + data.emplace_back(d, s); // Create and move a new ZeDMDFrameData object } // Destructor (no need to manually clear the vector) @@ -199,7 +199,7 @@ class ZeDMDComm virtual bool IsConnected(); void Run(); - void QueueCommand(char command, uint8_t* buffer, int size, uint16_t width, uint16_t height); + void QueueFrame(uint8_t* buffer, int size); void QueueCommand(char command, uint8_t* buffer, int size); void QueueCommand(char command); void QueueCommand(char command, uint8_t value); @@ -219,7 +219,6 @@ class ZeDMDComm uint16_t m_height = 32; bool m_s3 = false; bool m_cdc = false; - uint16_t m_zonesBytesLimit = 0; uint8_t m_zoneWidth = 8; uint8_t m_zoneHeight = 4; bool m_resendZones = false; @@ -232,10 +231,8 @@ class ZeDMDComm const void* m_logUserData = nullptr; uint64_t m_zoneHashes[128] = {0}; uint8_t m_zoneRepeatCounters[128] = {0}; - const uint8_t m_allBlack[49152] = {0}; + const uint8_t m_allBlack[32768] = {0}; - uint8_t m_flowControlCounter = 0; - uint8_t m_noReadySignalCounter = 0; char m_ignoredDevices[10][32] = {0}; uint8_t m_ignoredDevicesCounter = 0; char m_device[32] = {0}; diff --git a/src/ZeDMDWiFi.cpp b/src/ZeDMDWiFi.cpp index 150ce03..4a77eb3 100644 --- a/src/ZeDMDWiFi.cpp +++ b/src/ZeDMDWiFi.cpp @@ -243,7 +243,7 @@ bool ZeDMDWiFi::StreamBytes(ZeDMDFrame* pFrame) { ZeDMDFrameData frameData = *it; - if (frameData.size < ZEDMD_COMM_FRAME_SIZE_COMMAND_LIMIT && pFrame->command != 5) + if (frameData.size < ZEDMD_COMM_FRAME_SIZE_COMMAND_LIMIT && pFrame->command != ZEDMD_COMM_COMMAND::RGB565ZonesStream) { uint8_t data[ZEDMD_COMM_FRAME_SIZE_COMMAND_LIMIT + 1] = {0}; data[0] = pFrame->command; // command @@ -262,10 +262,10 @@ bool ZeDMDWiFi::StreamBytes(ZeDMDFrame* pFrame) } else { - uint8_t data[ZEDMD_WIFI_ZONES_BYTES_LIMIT] = {0}; + uint8_t data[ZEDMD_WIFI_MTU] = {0}; data[0] = pFrame->command; // command - mz_ulong compressedSize = mz_compressBound(ZEDMD_WIFI_MTU - 1); + mz_ulong compressedSize = mz_compressBound(ZEDMD_ZONES_BYTE_LIMIT); int status = mz_compress(&data[1], &compressedSize, frameData.data, frameData.size); if (compressedSize > (ZEDMD_WIFI_MTU - 1)) @@ -274,6 +274,12 @@ bool ZeDMDWiFi::StreamBytes(ZeDMDFrame* pFrame) return false; } + if (compressedSize > ZEDMD_ZONES_BYTE_LIMIT) + { + Log("ZeDMD Wifi error, compressed size of %d exceeds the ZEDMD_ZONES_BYTE_LIMIT of %d", compressedSize, ZEDMD_ZONES_BYTE_LIMIT); + return false; + } + if (status == MZ_OK) { #if defined(_WIN32) || defined(_WIN64) diff --git a/src/ZeDMDWiFi.h b/src/ZeDMDWiFi.h index d684357..a1e82ec 100644 --- a/src/ZeDMDWiFi.h +++ b/src/ZeDMDWiFi.h @@ -8,13 +8,13 @@ #include #include #include + #endif // Typically, the MTU is 1480 (1500 - 20 byte header). // We use our own command header of 4 bytes and compressed zones. // Even if the compression works bad on a specific frame, it should // be safe to fit the compressed zones within the MTU. -#define ZEDMD_WIFI_ZONES_BYTES_LIMIT 1500 #define ZEDMD_WIFI_MTU 1460 class ZeDMDWiFi : public ZeDMDComm @@ -22,7 +22,6 @@ class ZeDMDWiFi : public ZeDMDComm public: ZeDMDWiFi() : ZeDMDComm() { - m_zonesBytesLimit = ZEDMD_WIFI_ZONES_BYTES_LIMIT; m_resendZones = false; }