23
23
import copy
24
24
import importlib .util
25
25
import json
26
- import subprocess
27
- import sys
28
- import shutil
29
26
import os
30
- from os . path import join
27
+ import platform as sys_platform
31
28
import re
32
29
import requests
33
- import platform as sys_platform
30
+ import shutil
31
+ import subprocess
32
+ import sys
33
+ from os .path import join
34
34
from pathlib import Path
35
35
from urllib .parse import urlsplit , unquote
36
36
@@ -1668,6 +1668,7 @@ def get_python_exe():
1668
1668
if not os .path .isfile (python_exe_path ):
1669
1669
sys .stderr .write ("Error: Missing Python executable file `%s`\n " % python_exe_path )
1670
1670
env .Exit (1 )
1671
+
1671
1672
return python_exe_path
1672
1673
1673
1674
@@ -1677,8 +1678,8 @@ def get_python_exe():
1677
1678
1678
1679
ensure_python_venv_available ()
1679
1680
1680
- # ESP-IDF package doesn't contain .git folder, instead package version is specified
1681
- # in a special file "version.h" in the root folder of the package
1681
+ # ESP-IDF package version is determined from version.h file
1682
+ # since the package distribution doesn't include .git metadata
1682
1683
1683
1684
create_version_file ()
1684
1685
@@ -1717,7 +1718,7 @@ def get_python_exe():
1717
1718
1718
1719
1719
1720
#
1720
- # Current build script limitations
1721
+ # Known build system limitations
1721
1722
#
1722
1723
1723
1724
if any (" " in p for p in (FRAMEWORK_DIR , BUILD_DIR )):
@@ -1756,12 +1757,12 @@ def get_python_exe():
1756
1757
LIBSOURCE_DIRS = [str (Path (ARDUINO_FRAMEWORK_DIR ) / "libraries" )]
1757
1758
)
1758
1759
1759
- # Set ESP-IDF version environment variables (needed for proper Kconfig processing)
1760
+ # Configure ESP-IDF version environment variables for Kconfig processing
1760
1761
framework_version = get_framework_version ()
1761
1762
major_version = framework_version .split ('.' )[0 ] + '.' + framework_version .split ('.' )[1 ]
1762
1763
os .environ ["ESP_IDF_VERSION" ] = major_version
1763
1764
1764
- # Configure CMake arguments with ESP-IDF version
1765
+ # Setup CMake configuration arguments
1765
1766
extra_cmake_args = [
1766
1767
"-DIDF_TARGET=" + idf_variant ,
1767
1768
"-DPYTHON_DEPS_CHECKED=1" ,
@@ -1855,7 +1856,7 @@ def get_python_exe():
1855
1856
env .Depends ("$BUILD_DIR/$PROGNAME$PROGSUFFIX" , build_bootloader (sdk_config ))
1856
1857
1857
1858
#
1858
- # Target: ESP-IDF menuconfig
1859
+ # ESP-IDF menuconfig target implementation
1859
1860
#
1860
1861
1861
1862
env .AddPlatformTarget (
@@ -2000,8 +2001,8 @@ def _skip_prj_source_files(node):
2000
2001
):
2001
2002
project_env = env .Clone ()
2002
2003
if project_target_name != "__idf_main" :
2003
- # Manually add dependencies to CPPPATH since ESP-IDF build system doesn't generate
2004
- # this info if the folder with sources is not named 'main'
2004
+ # Add dependencies to CPPPATH for non-main source directories
2005
+ # ESP-IDF build system requires manual dependency handling for custom source folders
2005
2006
# https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html#rename-main
2006
2007
project_env .AppendUnique (CPPPATH = app_includes ["plain_includes" ])
2007
2008
@@ -2049,7 +2050,7 @@ def _skip_prj_source_files(node):
2049
2050
#
2050
2051
2051
2052
extra_elf2bin_flags = "--elf-sha256-offset 0xb0"
2052
- # https://github.com/espressif/esp-idf/blob/master/components/ esptool_py/project_include.cmake#L58
2053
+ # Reference: ESP-IDF esptool_py component configuration
2053
2054
# For chips that support configurable MMU page size feature
2054
2055
# If page size is configured to values other than the default "64KB" in menuconfig,
2055
2056
mmu_page_size = "64KB"
0 commit comments