mirror of
https://github.com/thelsing/knx.git
synced 2025-09-05 17:50:22 +02:00
another try for fixing the min problem
This commit is contained in:
parent
23b7b453f6
commit
3bf579f712
@ -183,7 +183,9 @@ uint32_t Platform::writeNonVolatileMemory(uint32_t relativeAddress, uint8_t* buf
|
||||
uint32_t end = bufferedEraseBlockEnd();
|
||||
|
||||
ptrdiff_t offset = relativeAddress - start;
|
||||
ptrdiff_t length = std::min(end - relativeAddress, (uint32_t)size);
|
||||
ptrdiff_t length = end - relativeAddress;
|
||||
if(length > size)
|
||||
length = size;
|
||||
memcpy(_eraseblockBuffer + offset, buffer, length);
|
||||
_bufferedEraseblockDirty = true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user