Skip to content

Commit a47bd2e

Browse files
committed
add ws platforms, build using the cli path
1 parent 18d7089 commit a47bd2e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

build_platform.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
"esp8266", "esp32", "metro_m4", "trinket_m0"),
131131
"arcada_platforms" : ("pybadge", "pygamer", "hallowing_m4",
132132
"cpb", "cpx_ada"),
133+
"wippersnapper_platforms" : ("metro_m4_airliftlite_tinyusb", "pyportal_tinyusb"),
133134
"rp2040_platforms" : ("pico_rp2040", "feather_rp2040")
134135
}
135136

@@ -227,7 +228,8 @@ def generate_uf2(example_path):
227228
return False
228229
# Convert .hex to .uf2
229230
family_id = ALL_PLATFORMS[platform][1]
230-
input_file = glob1(os.path.join(example_path, "build/*/*.hex"))
231+
cli_build_path = "build/*.*." + fqbn.split(':')[2] + "/*.hex"
232+
input_file = glob1(os.path.join(example_path, cli_build_path))
231233
output_file = os.path.splitext(input_file)[0] + ".uf2"
232234
cmd = ['python3', 'uf2conv.py', input_file, '-c', '-f', family_id, '-o', output_file]
233235
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@@ -249,9 +251,11 @@ def generate_uf2(example_path):
249251

250252
# expand groups:
251253
for arg in sys.argv[1:]:
252-
platform = ALL_PLATFORMS.get(arg, None)[0]
254+
platform = ALL_PLATFORMS.get(arg, None)
255+
print("254 platform ", platform)
253256
if isinstance(platform, str):
254-
platforms.append(arg)
257+
print('Platform append: ', platform)
258+
platforms.append(platform)
255259
elif isinstance(platform, collections.abc.Iterable):
256260
for p in platform:
257261
platforms.append(p)

0 commit comments

Comments
 (0)