Override default behavior of memory analysis feature

This commit is contained in:
valeros
2023-07-13 14:20:22 +03:00
parent a47ecbfca0
commit 28656548e2
2 changed files with 32 additions and 0 deletions
+6
View File
@@ -533,6 +533,12 @@ if any("-Wl,-T" in f for f in env.get("LINKFLAGS", [])):
print("Warning! '-Wl,-T' option for specifying linker scripts is deprecated. "
"Please use 'board_build.ldscript' option in your 'platformio.ini' file.")
#
# Override memory inspection behavior
#
env.SConscript("sizedata.py", exports="env")
#
# Default targets
#
+26
View File
@@ -0,0 +1,26 @@
import re
Import("env")
def pioSizeIsRamSectionCustom(env, section):
if section and re.search(
r"\.dram0\.data|\.dram0\.bss|\.noinit", section.get("name", "")
):
return True
return False
def pioSizeIsFlashectionCustom(env, section):
if section and re.search(
r"\.iram0\.text|\.iram0\.vectors|\.dram0\.data|\.flash\.text|\.flash\.rodata|\.flash\.appdesc",
section.get("name", ""),
):
return True
return False
env.AddMethod(pioSizeIsRamSectionCustom, "pioSizeIsRamSection")
env.AddMethod(pioSizeIsFlashectionCustom, "pioSizeIsFlashSection")