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 e138587 commit aecffee
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions apio/managers/scons.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,34 @@ def check_pip_packages(self, board_data):
# -- Raise an exception
raise ValueError(message) from exc

def serialize_programmer(self, board_data, sram, flash):
"""DOC: TODO"""
def serialize_programmer(
self, board_data: dict, sram: bool, flash: bool
) -> str:
"""
* INPUT:
* board_data: Dictionary with board information
* Board name
* FPGA
* Programmer type
* Programmer name
* USB id (vid, pid)
* sram: Perform sram programming
* flash: Perform flash programming
* OUTPUT: It returns a template string with the command line
to execute for uploading the circuit. It has the following
parameters (in the string):
* "${VID}" (optional): USB vendor id
* "${PID}" (optional): USB Product id
* "${FTDI_ID}" (optional): FTDI id
* "${SERIAL_PORT}" (optional): Serial port name
"""

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

prog_info = board_data.get("programmer")
content = self.resources.programmers.get(prog_info.get("type"))
content = self.resources.programmers.get(prog_type)

programmer = content.get("command")

Expand Down

0 comments on commit aecffee

Please sign in to comment.