Skip to content

Commit

Permalink
[openocd] Fix ignoring commands argument in call()
Browse files Browse the repository at this point in the history
  • Loading branch information
niklaut committed Mar 21, 2024
1 parent c177dbc commit c8652f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 1.4.1

- Fix error handling in `find_serial_port`.
- Fix ignoring commands argument in openocd `call()`.

## 1.4.0

Expand Down
6 changes: 3 additions & 3 deletions src/emdbg/debug/openocd.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ def call(commands: list[str] = None, config: list[Path] = None,
:return: The process return code if `blocking` or the Popen object.
"""
if log_output == False: log_output = "/dev/null"
commands = [f"log_output {log_output}"] if log_output is not None else []
commands += ["init"] + utils.listify(commands)
cmds = [f"log_output {log_output}"] if log_output is not None else []
cmds += ["init"] + utils.listify(commands)
config = utils.listify(config)
search = utils.listify(search)

Expand All @@ -97,7 +97,7 @@ def call(commands: list[str] = None, config: list[Path] = None,
binary, flags or "",
" ".join(map('-s "{}"'.format, search)),
" ".join(map('-f "{}"'.format, config)),
" ".join(map('-c "{}"'.format, commands))
" ".join(map('-c "{}"'.format, cmds))
)
LOGGER.debug(command_openocd)

Expand Down

0 comments on commit c8652f6

Please sign in to comment.