Fixed error in 'W25Qx_writePage' causing it skipping the blocks having an odd address

This commit is contained in:
Silvano Seva 2021-02-26 11:07:32 +01:00
parent 8f2dd371d1
commit 4038bf811e
1 changed files with 1 additions and 1 deletions

View File

@ -162,7 +162,7 @@ bool W25Qx_eraseSector(uint32_t addr)
ssize_t W25Qx_writePage(uint32_t addr, void* buf, size_t len) ssize_t W25Qx_writePage(uint32_t addr, void* buf, size_t len)
{ {
/* Keep 256-byte boundary to avoid wrap-around when writing */ /* Keep 256-byte boundary to avoid wrap-around when writing */
size_t addrRange = addr & 0x0001FF; size_t addrRange = addr & 0x0000FF;
size_t writeLen = len; size_t writeLen = len;
if((addrRange + len) > 0x100) if((addrRange + len) > 0x100)
{ {