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
@@ -119,7 +119,6 @@ PREFIX_FILE = boards/$(MCU_VARIANT)_prefix.c
|
||||
GEN_PINS_SRC = $(BUILD)/pins_gen.c
|
||||
GEN_PINS_HDR = $(HEADER_BUILD)/pins.h
|
||||
GEN_PINS_AF_CONST = $(HEADER_BUILD)/pins_af_const.h
|
||||
GEN_PINS_AF_PY = $(BUILD)/pins_af.py
|
||||
|
||||
CFLAGS_CORTEX_M = -mthumb -mabi=aapcs -fsingle-precision-constant -Wdouble-promotion
|
||||
|
||||
@@ -544,7 +543,7 @@ $(OBJ): | $(HEADER_BUILD)/pins.h
|
||||
# both pins_gen.c and pins.h
|
||||
$(BUILD)/%_gen.c $(HEADER_BUILD)/%.h $(HEADER_BUILD)/%_af_const.h: boards/$(BOARD)/%.csv $(MAKE_PINS) $(AF_FILE) $(PREFIX_FILE) | $(HEADER_BUILD)
|
||||
$(ECHO) "Create $@"
|
||||
$(Q)$(PYTHON) $(MAKE_PINS) --board $(BOARD_PINS) --af $(AF_FILE) --prefix $(PREFIX_FILE) --hdr $(GEN_PINS_HDR) --af-const $(GEN_PINS_AF_CONST) --af-py $(GEN_PINS_AF_PY) > $(GEN_PINS_SRC)
|
||||
$(Q)$(PYTHON) $(MAKE_PINS) --board $(BOARD_PINS) --af $(AF_FILE) --prefix $(PREFIX_FILE) --hdr $(GEN_PINS_HDR) --af-const $(GEN_PINS_AF_CONST) > $(GEN_PINS_SRC)
|
||||
|
||||
$(PY_BUILD)/nlr%.o: CFLAGS += -Os -fno-lto
|
||||
|
||||
|
||||
@@ -320,17 +320,6 @@ class Pins(object):
|
||||
val = "MP_ROM_INT(GPIO_{})".format(mux_name)
|
||||
print(" { %-*s %s }," % (mux_name_width + 26, key, val), file=af_const_file)
|
||||
|
||||
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(
|
||||
@@ -351,12 +340,6 @@ def main():
|
||||
help="Specifies header file for alternate function constants.",
|
||||
default="build/pins_af_const.h",
|
||||
)
|
||||
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",
|
||||
@@ -401,7 +384,6 @@ def main():
|
||||
pins.print()
|
||||
pins.print_header(args.hdr_filename)
|
||||
pins.print_af_hdr(args.af_const_filename)
|
||||
pins.print_af_py(args.af_py_filename)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user