examples/pins.py: Remove this pins printing example.
It's not supported on all ports, adds complexity to the build to generate pins_af.py, and can mostly be replicated just by printing the pin objects. Remove support for generating pins_af.py from all ports (nrf, stm32, renesas-ra, mimxrt, rp2). This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
committed by
Damien George
parent
cb37b7bba7
commit
59f3c7facb
@@ -480,7 +480,6 @@ set(GEN_PINS_MKPINS "${MICROPY_BOARDS_DIR}/make-pins.py")
|
||||
set(GEN_PINS_SRC "${CMAKE_BINARY_DIR}/pins_${MICROPY_BOARD}.c")
|
||||
set(GEN_PINS_HDR "${MICROPY_GENHDR_DIR}/pins.h")
|
||||
set(GEN_PINS_AF_CONST "${MICROPY_GENHDR_DIR}/pins_af_const.h")
|
||||
set(GEN_PINS_AF_PY "${CMAKE_BINARY_DIR}/pins_af.py")
|
||||
|
||||
if(EXISTS "${MICROPY_BOARDS_DIR}/${MICROPY_BOARD}/pins.csv")
|
||||
set(GEN_PINS_BOARD_CSV "${MICROPY_BOARDS_DIR}/${MICROPY_BOARD}/pins.csv")
|
||||
@@ -495,7 +494,7 @@ target_sources(${MICROPY_TARGET} PRIVATE
|
||||
add_custom_command(
|
||||
OUTPUT ${GEN_PINS_HDR} ${GEN_PINS_SRC}
|
||||
COMMAND ${Python3_EXECUTABLE} ${GEN_PINS_MKPINS} ${GEN_PINS_CSV_ARG} --af ${GEN_PINS_AF_CSV} --prefix ${GEN_PINS_PREFIX}
|
||||
--hdr ${GEN_PINS_HDR} --af-py ${GEN_PINS_AF_PY} > ${GEN_PINS_SRC}
|
||||
--hdr ${GEN_PINS_HDR} > ${GEN_PINS_SRC}
|
||||
DEPENDS
|
||||
${GEN_PINS_AF_CSV}
|
||||
${GEN_PINS_BOARD_CSV}
|
||||
|
||||
@@ -284,17 +284,6 @@ class Pins(object):
|
||||
)
|
||||
)
|
||||
|
||||
def print_af_py(self, af_py_filename):
|
||||
with open(af_py_filename, "wt") as af_py_file:
|
||||
print("PINS_AF = (", file=af_py_file)
|
||||
for named_pin in self.board_pins:
|
||||
print(" ('%s', " % named_pin.name(), end="", file=af_py_file)
|
||||
for af in named_pin.pin().alt_fn:
|
||||
if af.is_supported():
|
||||
print("(%d, '%s'), " % (af.idx, af.af_str), end="", file=af_py_file)
|
||||
print("),", file=af_py_file)
|
||||
print(")", file=af_py_file)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
@@ -309,12 +298,6 @@ def main():
|
||||
help="Specifies the alternate function file for the chip",
|
||||
default="rp2_af.csv",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--af-py",
|
||||
dest="af_py_filename",
|
||||
help="Specifies the filename for the python alternate function mappings.",
|
||||
default="build/pins_af.py",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-b",
|
||||
"--board",
|
||||
@@ -356,7 +339,6 @@ def main():
|
||||
print(prefix_file.read())
|
||||
pins.print()
|
||||
pins.print_header(args.hdr_filename, True)
|
||||
pins.print_af_py(args.af_py_filename)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user