1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

Fix short unaligned writes in SPIFFS HAL (#924)

This commit is contained in:
Ivan Grokhotkov 2015-10-25 23:25:03 +03:00
parent f328e66fd7
commit 405b23876c

View File

@ -110,6 +110,8 @@ int32_t spiffs_hal_write(uint32_t addr, uint32_t size, uint8_t *src) {
if (addr < alignedBegin) {
uint32_t nb = alignedBegin - addr;
if (nb > size)
nb = size;
uint32_t tmp = 0xffffffff;
memcpy(((uint8_t* )&tmp) + 4 - nb, src, nb);
if (!ESP.flashWrite(alignedBegin - 4, &tmp, 4)) {