@@ -107,7 +107,7 @@ def main():
107
107
108
108
parser .add_argument ("-m" , "--mcu" ,
109
109
metavar = "MCU" ,
110
- type = argparse_force_uppercase_type ( targetnames , "MCU" ) ,
110
+ type = str . upper ,
111
111
help = "generate project for the given MCU ({})" .format (
112
112
', ' .join (targetnames )))
113
113
@@ -235,19 +235,17 @@ def main():
235
235
if exists (EXPORT_DIR ):
236
236
rmtree (EXPORT_DIR )
237
237
238
- for mcu in options .mcu :
239
- zip_proj = not bool (options .source_dir )
238
+ zip_proj = not bool (options .source_dir )
240
239
241
240
if (options .program is None ) and (not options .source_dir ):
242
241
args_error (parser , "one of -p, -n, or --source is required" )
243
- # Export to selected toolchain
244
242
exporter , toolchain_name = get_exporter_toolchain (options .ide )
245
- if options .mcu not in exporter .TARGETS :
246
- args_error (parser , "%s not supported by %s" % (options .mcu ,options .ide ))
243
+ mcu = extract_mcus (parser , options )[0 ]
244
+ if not exporter .is_target_supported (mcu ):
245
+ args_error (parser , "%s not supported by %s" % (mcu ,options .ide ))
247
246
profile = extract_profile (parser , options , toolchain_name , fallback = "debug" )
248
247
if options .clean :
249
248
rmtree (BUILD_DIR )
250
- mcu = extract_mcus (parser , options )[0 ]
251
249
export (mcu , options .ide , build = options .build ,
252
250
src = options .source_dir , macros = options .macros ,
253
251
project_id = options .program , zip_proj = zip_proj ,
0 commit comments