Show Metrics for ESP32x firmware (#18461)

This commit is contained in:
Jason2866 2023-04-20 20:26:07 +02:00 committed by GitHub
parent 11a43ea99b
commit 49d5356ea3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -28,5 +28,11 @@ def bin_map_copy(source, target, env):
shutil.move(tasmotapiolib.get_source_map_path(env), map_file)
if env["PIOPLATFORM"] == "espressif32":
shutil.copy(factory, one_bin_file)
# Print Metrics for firmware using "map" file
import esp_idf_size
CYAN = '\033[96m'
ENDC = '\033[0m'
print(CYAN + "=============================================================================================" + ENDC)
env.Execute("$PYTHONEXE -m esp_idf_size " + str(map_file.resolve()))
print(CYAN + "=============================================================================================" + ENDC)
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", bin_map_copy)