spi: flash: support the 256-byte wraparound when programming pages

tags/0.1.0
S.J.R. van Schaik 8 years ago
parent 3d33e5e0ce
commit 3395eb1a82
  1. 1
      source/drivers/spi_flash.c

@ -130,6 +130,7 @@ static size_t spi_flash_write(struct flash_dev *dev, uint32_t addr,
spi_flash_addr(cmd, addr);
nbytes = min(len, 32);
nbytes = nbytes - ((addr + nbytes) & 0xff);
memmove(cmd + 4, data, nbytes);
spi_tx_rx(spi_dev, NULL, 0, cmd, 4 + nbytes);

Loading…
Cancel
Save