|
24 | 24 |
|
25 | 25 | # Extends: https://github.com/platformio/platform-espressif32/blob/develop/builder/main.py
|
26 | 26 |
|
27 |
| -from os.path import isdir, join |
| 27 | +from os.path import isdir, isfile, join |
28 | 28 |
|
29 | 29 | from SCons.Script import DefaultEnvironment
|
30 | 30 |
|
|
158 | 158 | # Generate partition table
|
159 | 159 | #
|
160 | 160 |
|
161 |
| -# Export path to the partitions table |
| 161 | +fwpartitions_dir = join(FRAMEWORK_DIR, "tools", "partitions") |
| 162 | +partitions_csv = env.BoardConfig().get("build.partitions", "default.csv") |
162 | 163 | env.Replace(
|
163 |
| - PARTITION_TABLE_CSV=join( |
164 |
| - FRAMEWORK_DIR, "tools", "partitions", |
165 |
| - "%s.csv" % env.BoardConfig().get("build.partitions", "default") |
166 |
| - ) |
167 |
| -) |
| 164 | + PARTITIONS_TABLE_CSV=join(fwpartitions_dir, partitions_csv) if isfile( |
| 165 | + join(fwpartitions_dir, partitions_csv)) else partitions_csv) |
168 | 166 |
|
169 | 167 | partition_table = env.Command(
|
170 | 168 | join("$BUILD_DIR", "partitions.bin"),
|
171 |
| - "$PARTITION_TABLE_CSV", |
| 169 | + "$PARTITIONS_TABLE_CSV", |
172 | 170 | env.VerboseAction('"$PYTHONEXE" "%s" -q $SOURCE $TARGET' % join(
|
173 | 171 | FRAMEWORK_DIR, "tools", "gen_esp32part.py"),
|
174 | 172 | "Generating partitions $TARGET"))
|
|
0 commit comments