forked from platformio/platformio-core
Print platform information while processing environment
This commit is contained in:
2
docs
2
docs
Submodule docs updated: 0523223955...b32cd4a5f8
@ -98,29 +98,34 @@ def LoadPioPlatform(env, variables):
|
|||||||
env.Replace(LDSCRIPT_PATH=board_config.get("build.ldscript"))
|
env.Replace(LDSCRIPT_PATH=board_config.get("build.ldscript"))
|
||||||
|
|
||||||
|
|
||||||
def PrintSystemInfo(env):
|
def PrintConfiguration(env): # pylint: disable=too-many-branches
|
||||||
data = []
|
platform_data = ["Platform: %s ::" % env.PioPlatform().title]
|
||||||
debug_tools = None
|
system_data = ["System:"]
|
||||||
mcu = env.subst("$BOARD_MCU")
|
mcu = env.subst("$BOARD_MCU")
|
||||||
f_cpu = env.subst("$BOARD_F_CPU")
|
f_cpu = env.subst("$BOARD_F_CPU")
|
||||||
if mcu:
|
if mcu:
|
||||||
data.append(mcu.upper())
|
system_data.append(mcu.upper())
|
||||||
if f_cpu:
|
if f_cpu:
|
||||||
f_cpu = int("".join([c for c in str(f_cpu) if c.isdigit()]))
|
f_cpu = int("".join([c for c in str(f_cpu) if c.isdigit()]))
|
||||||
data.append("%dMHz" % (f_cpu / 1000000))
|
system_data.append("%dMHz" % (f_cpu / 1000000))
|
||||||
|
|
||||||
|
debug_tools = None
|
||||||
if "BOARD" in env:
|
if "BOARD" in env:
|
||||||
board_config = env.BoardConfig()
|
board_config = env.BoardConfig()
|
||||||
|
platform_data.append(board_config.get("name"))
|
||||||
|
|
||||||
debug_tools = board_config.get("debug", {}).get("tools")
|
debug_tools = board_config.get("debug", {}).get("tools")
|
||||||
ram = board_config.get("upload", {}).get("maximum_ram_size")
|
ram = board_config.get("upload", {}).get("maximum_ram_size")
|
||||||
flash = board_config.get("upload", {}).get("maximum_size")
|
flash = board_config.get("upload", {}).get("maximum_size")
|
||||||
for (key, value) in (("RAM", ram), ("Flash", flash)):
|
for (key, value) in (("RAM", ram), ("Flash", flash)):
|
||||||
if not value:
|
if not value:
|
||||||
continue
|
continue
|
||||||
data.append("%s/%s" % (key, util.format_filesize(value)))
|
system_data.append("%s/%s" % (key, util.format_filesize(value)))
|
||||||
|
|
||||||
if data:
|
if platform_data:
|
||||||
print "System: %s" % " ".join(data)
|
print " ".join(platform_data)
|
||||||
|
if system_data:
|
||||||
|
print " ".join(system_data)
|
||||||
|
|
||||||
# Debugging
|
# Debugging
|
||||||
if not debug_tools:
|
if not debug_tools:
|
||||||
@ -151,5 +156,5 @@ def generate(env):
|
|||||||
env.AddMethod(BoardConfig)
|
env.AddMethod(BoardConfig)
|
||||||
env.AddMethod(GetFrameworkScript)
|
env.AddMethod(GetFrameworkScript)
|
||||||
env.AddMethod(LoadPioPlatform)
|
env.AddMethod(LoadPioPlatform)
|
||||||
env.AddMethod(PrintSystemInfo)
|
env.AddMethod(PrintConfiguration)
|
||||||
return env
|
return env
|
||||||
|
@ -42,7 +42,7 @@ def BuildProgram(env):
|
|||||||
|
|
||||||
_append_pio_macros()
|
_append_pio_macros()
|
||||||
|
|
||||||
env.PrintSystemInfo()
|
env.PrintConfiguration()
|
||||||
|
|
||||||
# fix ASM handling under non case-sensitive OS
|
# fix ASM handling under non case-sensitive OS
|
||||||
if not case_sensitive_suffixes(".s", ".S"):
|
if not case_sensitive_suffixes(".s", ".S"):
|
||||||
|
@ -755,9 +755,9 @@ def format_filesize(filesize):
|
|||||||
if filesize >= unit:
|
if filesize >= unit:
|
||||||
continue
|
continue
|
||||||
if filesize % (base**(i + 1)):
|
if filesize % (base**(i + 1)):
|
||||||
return "%.2f%s" % ((base * filesize / unit), suffix)
|
return "%.2f%sB" % ((base * filesize / unit), suffix)
|
||||||
break
|
break
|
||||||
return "%d%s" % ((base * filesize / unit), suffix)
|
return "%d%sB" % ((base * filesize / unit), suffix)
|
||||||
|
|
||||||
|
|
||||||
def rmtree_(path):
|
def rmtree_(path):
|
||||||
|
@ -55,7 +55,7 @@ def generate_boards(boards, extend_debug=False, skip_columns=None):
|
|||||||
("Platform", ":ref:`{platform_title} <platform_{platform}>`"),
|
("Platform", ":ref:`{platform_title} <platform_{platform}>`"),
|
||||||
("Debug", "{debug}"),
|
("Debug", "{debug}"),
|
||||||
("MCU", "{mcu}"),
|
("MCU", "{mcu}"),
|
||||||
("Frequency", "{f_cpu:d} MHz"),
|
("Frequency", "{f_cpu:d}MHz"),
|
||||||
("Flash", "{rom}"),
|
("Flash", "{rom}"),
|
||||||
("RAM", "{ram}"),
|
("RAM", "{ram}"),
|
||||||
]
|
]
|
||||||
|
Reference in New Issue
Block a user