Merge branch 'Branch_flash_pr_with_large_eeprom' of https://github.com/SirSydom/knx into Branch_flash_pr_with_large_eeprom

This commit is contained in:
SirSydom 2022-02-19 09:06:27 +01:00
commit 4513e1de2a
2 changed files with 2 additions and 15 deletions

View File

@ -179,8 +179,8 @@ uint32_t Platform::writeNonVolatileMemory(uint32_t relativeAddress, uint8_t* buf
while (size > 0)
{
loadEraseblockContaining(relativeAddress);
uint32_t start = bufferedEraseBlockStart();
uint32_t end = bufferedEraseBlockEnd();
uint32_t start = _bufferedEraseblockNumber * (flashEraseBlockSize() * flashPageSize());
uint32_t end = start + (flashEraseBlockSize() * flashPageSize());
ptrdiff_t offset = relativeAddress - start;
ptrdiff_t length = end - relativeAddress;
@ -217,17 +217,6 @@ void Platform::loadEraseblockContaining(uint32_t relativeAddress)
bufferEraseBlock(blockNum);
}
uint32_t Platform::bufferedEraseBlockStart()
{
return _bufferedEraseblockNumber * (flashEraseBlockSize() * flashPageSize());
}
uint32_t Platform::bufferedEraseBlockEnd()
{
return (_bufferedEraseblockNumber + 1) * (flashEraseBlockSize() * flashPageSize()) -1;
}
int32_t Platform::getEraseBlockNumberOf(uint32_t relativeAddress)
{
return relativeAddress / (flashEraseBlockSize() * flashPageSize());

View File

@ -98,8 +98,6 @@ class Platform
NvMemoryType _memoryType = Eeprom;
void loadEraseblockContaining(uint32_t relativeAddress);
uint32_t bufferedEraseBlockStart();
uint32_t bufferedEraseBlockEnd();
int32_t getEraseBlockNumberOf(uint32_t relativeAddress);
// writes _eraseblockBuffer to flash
virtual void writeBufferedEraseBlock();