Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New flash writing method with offset/memory/size alignment handling #7514

Merged
merged 25 commits into from
Oct 15, 2020
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
701197d
Do not write more data than requested on PUYA flashes
drzony Aug 7, 2020
1def1c3
Merge branch 'master' into puya_flash_fixes
drzony Aug 9, 2020
02adea2
Always align flash reads/writes to 4 bytes
drzony Aug 10, 2020
f079f00
fixup! Always align flash reads/writes to 4 bytes
drzony Aug 10, 2020
e1cd190
fixup! Always align flash reads/writes to 4 bytes
drzony Aug 10, 2020
6cc5f1d
fixup! Always align flash reads/writes to 4 bytes
drzony Aug 11, 2020
7953559
Merge branch 'master' into puya_flash_fixes
drzony Aug 11, 2020
77da49c
Merge branch 'master' into puya_flash_fixes
drzony Aug 11, 2020
0a7b89a
Merge branch 'master' into puya_flash_fixes
drzony Oct 6, 2020
d941932
Check for result before additional read/write
drzony Oct 6, 2020
3cefcd9
Merge branch 'master' into puya_flash_fixes
drzony Oct 8, 2020
2bd885f
Add overloads for unaligned reads/writes
drzony Oct 8, 2020
d850f65
fixup! Add overloads for unaligned reads/writes
drzony Oct 8, 2020
5175867
fixup! Add overloads for unaligned reads/writes
drzony Oct 8, 2020
94c2df3
fixup! Add overloads for unaligned reads/writes
drzony Oct 8, 2020
64ceb92
fixup! Add overloads for unaligned reads/writes
drzony Oct 8, 2020
279a293
fixup! Add overloads for unaligned reads/writes
drzony Oct 9, 2020
c0d0257
fixup! Add overloads for unaligned reads/writes
drzony Oct 11, 2020
b3b3957
fixup! Add overloads for unaligned reads/writes
drzony Oct 11, 2020
a476e1b
Merge branch 'master' into puya_flash_fixes
drzony Oct 11, 2020
f2a6e0e
Add tests for flashRead/flashWrite
drzony Oct 11, 2020
eeb96fc
fixup! Add overloads for unaligned reads/writes
drzony Oct 12, 2020
7905a29
fixup! Add tests for flashRead/flashWrite
drzony Oct 12, 2020
323ffc0
fixup! Add tests for flashRead/flashWrite
drzony Oct 12, 2020
b919faa
fixup! Add overloads for unaligned reads/writes
drzony Oct 12, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cores/esp8266/Esp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,15 +698,15 @@ static SpiFlashOpResult spi_flash_write_puya(uint32_t offset, uint32_t *data, si
bytesLeft = 0;
}
size_t bytesAligned = (bytesNow + 3) & ~3;
rc = spi_flash_read(pos, flash_write_puya_buf, bytesAligned);
rc = spi_flash_read(pos, flash_write_puya_buf, bytesNow);
devyte marked this conversation as resolved.
Show resolved Hide resolved
if (rc != SPI_FLASH_RESULT_OK) {
return rc;
}
for (size_t i = 0; i < bytesAligned / 4; ++i) {
flash_write_puya_buf[i] &= *ptr;
++ptr;
}
rc = spi_flash_write(pos, flash_write_puya_buf, bytesAligned);
rc = spi_flash_write(pos, flash_write_puya_buf, bytesNow);
devyte marked this conversation as resolved.
Show resolved Hide resolved
pos += bytesNow;
}
return rc;
Expand Down