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 aecffee commit 2eb1eeb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
"console": "internalConsole",
"justMyCode": true,
//-- Change to the folder with the example to test

//-- Testing the TinyFPGA board
"cwd": "${workspaceFolder}/test-examples/TinyFPGA-BX/01-LED-ON"

//-- Testing the Alhanbra-II board
//"cwd": "${workspaceFolder}/test-examples/Alhambra-II/ledon"
}
]
}
11 changes: 10 additions & 1 deletion apio/managers/scons.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,14 +456,23 @@ def serialize_programmer(
* "${PID}" (optional): USB Product id
* "${FTDI_ID}" (optional): FTDI id
* "${SERIAL_PORT}" (optional): Serial port name
Example of output strings:
"'tinyprog --pyserial -c ${SERIAL_PORT} --program'"
"'iceprog -d i:0x${VID}:0x${PID}:${FTDI_ID}'"
"""

# -- Get the programmer type
# -- Ex. type: "tinyprog"
# -- Ex. type: "icesprog"
prog_info = board_data["programmer"]
prog_type = prog_info["type"]

content = self.resources.programmers.get(prog_type)
# -- Get all the information for that type of programmer
# -- * command
# -- * arguments
# -- * pip package
content = self.resources.programmers[prog_type]

programmer = content.get("command")

Expand Down

0 comments on commit 2eb1eeb

Please sign in to comment.