Skip to content

Commit

Permalink
Align HyperSPI buffer for rp2040 to 256 (x6)
Browse files Browse the repository at this point in the history
  • Loading branch information
awawa-dev committed Aug 1, 2023
1 parent 3a89e06 commit ac999e9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions sources/leddevice/dev_spi/ProviderSpi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,8 @@ int ProviderSpi::writeBytesEsp8266(unsigned size, const uint8_t* data)

int ProviderSpi::writeBytesRp2040(unsigned size, const uint8_t* data)
{
// try to use constant buffer size similar to esp32
static const int REAL_BUFFER = 1536;
static const uint32_t BUFFER_SIZE = REAL_BUFFER + 8;
static const uint32_t BUFFER_SIZE = REAL_BUFFER ;

uint8_t* startData = (uint8_t*)data;
uint8_t* endData = (uint8_t*)data + size;
Expand All @@ -218,7 +217,6 @@ int ProviderSpi::writeBytesRp2040(unsigned size, const uint8_t* data)
{
buffer[i] = *startData;
}
buffer[REAL_BUFFER] = 0xAA;
retVal = ioctl(_fid, SPI_IOC_MESSAGE(1), &_spi);
ErrorIf((retVal < 0), _log, "SPI failed to write. errno: %d, %s", errno, strerror(errno));
}
Expand Down

0 comments on commit ac999e9

Please sign in to comment.