mirror of
https://github.com/thelsing/knx.git
synced 2025-08-13 13:46:20 +02:00
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:
commit
4513e1de2a
@ -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());
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user