Set max transfer size to 1024 bytes for SPI RAM due to 1K page limit on 64M part

pull/19/head
Blackaddr 2 years ago
parent 167d8b82a1
commit f70bc3b748
  1. 5
      src/peripherals/BASpiMemory.cpp

@ -49,7 +49,7 @@ constexpr int SPI_ADDR_1_SHIFT = 8;
constexpr int SPI_ADDR_0_MASK = 0x0000FF;
constexpr int CMD_ADDRESS_SIZE = 4;
constexpr int MAX_DMA_XFER_SIZE = 0x4000;
constexpr int MAX_DMA_XFER_SIZE = 0x400;
constexpr size_t MEM_ALIGNED_ALLOC = 32; // number of bytes to align DMA buffer to
@ -247,8 +247,9 @@ size_t BASpiMemory::m_bytesToXfer(size_t address, size_t numBytes)
{
// Check if this burst will cross the die boundary
size_t bytesToXfer = numBytes;
if (bytesToXfer > MAX_DMA_XFER_SIZE) { bytesToXfer = MAX_DMA_XFER_SIZE; }
if (m_dieBoundary) {
if ((address < m_dieBoundary) && (address+numBytes > m_dieBoundary)) {
if ((address < m_dieBoundary) && (address+bytesToXfer > m_dieBoundary)) {
// split into two xfers
bytesToXfer = m_dieBoundary-address;
}

Loading…
Cancel
Save