Skip to content

Commit

Permalink
scons: serialize_programmer(): clean code, add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Obijuan committed Mar 4, 2024
1 parent 7908fb7 commit e5b3413
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions apio/managers/scons.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,21 +480,14 @@ def serialize_programmer(
# -- Ex. "iceprog"
programmer = content["command"]

# dfu-util needs extra args first
if programmer.startswith("dfu-util"):
if prog_info.get("extra_args"):
programmer += f" {prog_info.get('extra_args')}"

if content.get("args"):
programmer += f" {content.get('args')}"
else:
# Add args
if content.get("args"):
programmer += f" {content.get('args')}"

# Add extra args
if prog_info.get("extra_args"):
programmer += f" {prog_info.get('extra_args')}"
# -- Let's add the arguments for executing the programmer
if content["args"]:
programmer += f" {content['args']}"

# -- Some tools need extra arguments
# -- (like dfu-util for example)
if prog_info.get("extra_args"):
programmer += f" {prog_info.get('extra_args')}"

# Enable SRAM programming
if sram:
Expand Down

0 comments on commit e5b3413

Please sign in to comment.