From d8a9a4a8d67ddace50002688c0e1bf4a41c1dab7 Mon Sep 17 00:00:00 2001 From: Jan Vos Date: Wed, 12 Aug 2026 00:23:19 +0200 Subject: [PATCH] Remove parsing of CRC32 in SPI header --- src/dmdreader.cpp | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/dmdreader.cpp b/src/dmdreader.cpp index a47cd79a..0e95e145 100644 --- a/src/dmdreader.cpp +++ b/src/dmdreader.cpp @@ -23,7 +23,6 @@ typedef struct buf32_t { // SPI data types and header blocks // header block length should always be a multiple of 32bit #define SPI_BLOCK_PIX 0xcc33 // DMD frame -#define SPI_BLOCK_PIX_CRC 0x44ee // DMD frame with CRC32 checksum typedef struct __attribute__((__packed__)) block_header_t { uint16_t block_type; // block type @@ -34,17 +33,9 @@ typedef struct __attribute__((__packed__)) block_pix_header_t { uint16_t columns; // number of columns uint16_t rows; // number of rows uint16_t bitsperpixel; // bits per pixel - uint16_t padding; + uint16_t padding; // padding bits } block_pix_header_t __attribute__((aligned(4))); -typedef struct __attribute__((__packed__)) block_pix_crc_header_t { - uint16_t columns; // number of columns - uint16_t rows; // number of rows - uint16_t bitsperpixel; // bits per pixel - uint16_t padding; - uint32_t crc32; // crc32 of the pixel data -} block_pix_crc_header_t __attribute__((aligned(4))); - DmdType dmd_type; // Line oversampling @@ -245,16 +236,15 @@ void finish_spi() { digitalWrite(SPI0_CS, LOW); } * * @param pixbuf a frame to send */ -bool spi_send_pix(uint8_t *pixbuf, uint32_t crc32, bool skip_when_busy) { - block_header_t h = {.block_type = SPI_BLOCK_PIX_CRC}; - block_pix_crc_header_t ph = {}; +bool spi_send_pix(uint8_t *pixbuf, bool skip_when_busy) { + block_header_t h = {.block_type = SPI_BLOCK_PIX}; + block_pix_header_t ph = {}; // round length to 4-byte blocks h.len = (((target_bytes + 3) / 4) * 4) + sizeof(h) + sizeof(ph); ph.columns = source_width; ph.rows = source_height; ph.bitsperpixel = target_bitsperpixel; - ph.crc32 = crc32; if (skip_when_busy) { if (spi_busy()) return false; @@ -1547,7 +1537,7 @@ void dmdreader_spi_init() { bool dmdreader_spi_send() { if (!loopback && frame_received) { frame_received = false; - spi_send_pix(framebuf_to_send, frame_crc, true); + spi_send_pix(framebuf_to_send, true); return true; }