From 2b8ad2f1ad4b55ba90ca1f4458545bb464a81dc5 Mon Sep 17 00:00:00 2001 From: Marco Scholl Date: Sun, 7 May 2023 11:52:39 +0200 Subject: [PATCH] support KNX_FLASH_OFFSET on samd --- src/samd_platform.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/samd_platform.cpp b/src/samd_platform.cpp index a1eb786..49b9ec4 100644 --- a/src/samd_platform.cpp +++ b/src/samd_platform.cpp @@ -91,8 +91,13 @@ void SamdPlatform::init() // find end of program flash and set limit to next row uint32_t endEddr = (uint32_t)(&__etext + (&__data_end__ - &__data_start__)); // text + data MemoryBlock +#ifdef KNX_FLASH_OFFSET + _MemoryStart = KNX_FLASH_OFFSET; + _MemoryEnd = KNX_FLASH_OFFSET + KNX_FLASH_SIZE; +#else _MemoryStart = getRowAddr(_pageSize * _pageCnt - KNX_FLASH_SIZE - 1); // 23295 _MemoryEnd = getRowAddr(_pageSize * _pageCnt - 1); +#endif // chosen flash size is not available anymore if (_MemoryStart < endEddr) { println("KNX_FLASH_SIZE is not available (possible too much flash use by firmware)");