Skip to content

Commit 0fc0d5b

Browse files
authored
Update build_system.py (#304)
1 parent 2645a58 commit 0fc0d5b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

ner_environment/build_system/build_system.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def clang(disable: bool = typer.Option(False, "--disable","-d", help="Disable cl
9494
@app.command(help="Start a debug session")
9595
def debug(ftdi: bool = typer.Option(False, "--ftdi", help="DEPRECATED (On by default) Set this flag if the device uses an FTDI chip"),
9696
no_ftdi: bool = typer.Option(False, "--no-ftdi", help="Set this flag if the device uses an CMSIS DAP chip"),
97+
custom: bool = typer.Option(False, "--custom", help="Set this flag if your flash.cfg has all definitions (LAUNCHPAD)."),
9798
docker: bool = typer.Option(False, "--docker", callback=unsupported_option_cb, help="(deprecated) Use OpenOCD in the container instead of locally, requires linux")):
9899

99100
command = ["openocd"]
@@ -102,7 +103,7 @@ def debug(ftdi: bool = typer.Option(False, "--ftdi", help="DEPRECATED (On by def
102103
if not no_ftdi:
103104
ftdi_path = os.path.join(current_directory, "Drivers", "Embedded-Base", "ftdi_flash.cfg")
104105
command = command + ["-f", ftdi_path]
105-
else:
106+
elif not custom:
106107
command = command + ["-f", "interface/cmsis-dap.cfg"]
107108

108109
build_directory = os.path.join("build", "*.elf")
@@ -144,6 +145,7 @@ def debug(ftdi: bool = typer.Option(False, "--ftdi", help="DEPRECATED (On by def
144145
@app.command(help="Flash the firmware")
145146
def flash(ftdi: bool = typer.Option(False, "--ftdi", help="DEPRECATED (On by default): Set this flag if the device uses an FTDI chip"),
146147
no_ftdi: bool = typer.Option(False, "--no-ftdi", help="Set this flag if the device uses an CMSIS DAP chip"),
148+
custom: bool = typer.Option(False, "--custom", help="Set this flag if your flash.cfg has all definitions (LAUNCHPAD)."),
147149
docker: bool = typer.Option(False, "--docker", help="Use OpenOCD in the container instead of locally, requires linux")):
148150

149151
command = []
@@ -161,7 +163,7 @@ def flash(ftdi: bool = typer.Option(False, "--ftdi", help="DEPRECATED (On by def
161163
current_directory = os.getcwd()
162164
ftdi_path = os.path.join(current_directory, "Drivers", "Embedded-Base", "ftdi_flash.cfg")
163165
command = command + ["-f", ftdi_path]
164-
else:
166+
elif not custom:
165167
command = command + ["-f", "interface/cmsis-dap.cfg"]
166168

167169

0 commit comments

Comments
 (0)