summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2023-08-03 15:36:33 +1000
committerDamien George <damien@micropython.org>2023-11-03 14:01:30 +1100
commitdf28aa1a595afcefaa164e61af38b9b17d83fa6b (patch)
tree542cdb126b4224d3ae9ce893804f82e6d2c08135
parent3f99dbd634f728e98ef5b14f838ecb62ff946d0a (diff)
renesas-ra/boards/make-pins.py: Don't generate qstrs.
The output pins.c can be processed for qstrs like any other C file. Also remove af_const from Makefile (unimplemented in make-pins.py) and fix target dependency on ad_const. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
-rw-r--r--ports/renesas-ra/Makefile19
-rw-r--r--ports/renesas-ra/boards/make-pins.py39
2 files changed, 8 insertions, 50 deletions
diff --git a/ports/renesas-ra/Makefile b/ports/renesas-ra/Makefile
index 943ed6d9b..e77843b1e 100644
--- a/ports/renesas-ra/Makefile
+++ b/ports/renesas-ra/Makefile
@@ -27,12 +27,11 @@ USE_FSP_LPM ?= 1
USE_FSP_QSPI ?= 0
FSP_BOARD_NAME ?= $(shell echo $(BOARD) | tr '[:upper:]' '[:lower:]')
-# Files that are generated and needed before the QSTR build.
-#QSTR_GENERATED_HEADERS = $(BUILD)/pins_qstr.h $(BUILD)/modstm_qstr.h
-QSTR_GENERATED_HEADERS = $(BUILD)/pins_qstr.h
# qstr definitions (must come before including py.mk)
-QSTR_DEFS += qstrdefsport.h $(QSTR_GENERATED_HEADERS)
-QSTR_GLOBAL_DEPENDENCIES += mpconfigboard_common.h $(BOARD_DIR)/mpconfigboard.h $(QSTR_GENERATED_HEADERS)
+QSTR_DEFS += qstrdefsport.h
+
+# Files that are generated and needed before the QSTR build.
+QSTR_GLOBAL_DEPENDENCIES += mpconfigboard_common.h $(BOARD_DIR)/mpconfigboard.h
# MicroPython feature configurations
MICROPY_ROM_TEXT_COMPRESSION ?= 1
@@ -557,16 +556,14 @@ AF_FILE = boards/ra6m5_af.csv
endif
GEN_PINS_SRC = $(BUILD)/pins_$(BOARD).c
GEN_PINS_HDR = $(HEADER_BUILD)/pins.h
-GEN_PINS_QSTR = $(BUILD)/pins_qstr.h
+# Currently unused.
GEN_PINS_AD_CONST = $(HEADER_BUILD)/pins_ad_const.h
-GEN_PINS_AF_CONST = $(HEADER_BUILD)/pins_af_const.h
-#GEN_PINS_AF_DEFS = $(HEADER_BUILD)/pins_af_defs.h
GEN_PINS_AF_PY = $(BUILD)/pins_af.py
FILE2H = $(TOP)/tools/file2h.py
# List of sources for qstr extraction
-SRC_QSTR += $(SRC_C) $(SRC_CXX) $(SHARED_SRC_C)
+SRC_QSTR += $(SRC_C) $(SRC_CXX) $(SHARED_SRC_C) $(GEN_PINS_SRC)
# Making OBJ use an order-only depenedency on the generated pins.h file
# has the side effect of making the pins.h file before we actually compile
@@ -582,9 +579,9 @@ $(HEADER_BUILD)/qstrdefs.generated.h: $(BOARD_DIR)/mpconfigboard.h
# Use a pattern rule here so that make will only call make-pins.py once to make
# both pins_$(BOARD).c and pins.h
.PRECIOUS: $(GEN_PINS_SRC)
-$(BUILD)/%_$(BOARD).c $(HEADER_BUILD)/%.h $(HEADER_BUILD)/%_af_const.h $(HEADER_BUILD)/%_af_defs.h $(BUILD)/%_qstr.h: $(BOARD_DIR)/%.csv $(MAKE_PINS) $(AF_FILE) $(PREFIX_FILE) | $(HEADER_BUILD)
+$(BUILD)/%_$(BOARD).c $(HEADER_BUILD)/%.h $(HEADER_BUILD)/%_ad_const.h: $(BOARD_DIR)/%.csv $(MAKE_PINS) $(AF_FILE) $(PREFIX_FILE) | $(HEADER_BUILD)
$(ECHO) "GEN $@"
- $(Q)$(PYTHON) $(MAKE_PINS) --board $(BOARD_PINS) --af $(AF_FILE) --prefix $(PREFIX_FILE) --hdr $(GEN_PINS_HDR) --qstr $(GEN_PINS_QSTR) --ad-const $(GEN_PINS_AD_CONST) --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) --ad-const $(GEN_PINS_AD_CONST) --af-py $(GEN_PINS_AF_PY) > $(GEN_PINS_SRC)
CMSIS_MCU_HDR = $(CMSIS_DIR)/$(CMSIS_MCU_LOWER).h
diff --git a/ports/renesas-ra/boards/make-pins.py b/ports/renesas-ra/boards/make-pins.py
index 5147d2794..4127c9ff1 100644
--- a/ports/renesas-ra/boards/make-pins.py
+++ b/ports/renesas-ra/boards/make-pins.py
@@ -41,9 +41,6 @@ class PinAD(object):
hdr_file.write("extern const pin_ad_obj_t pin_{:s}_ad_obj;\n".format(n))
hdr_file.write("#define pin_{:s}_ad (&pin_{:s}_ad_obj)\n".format(n, n))
- def qstr_list(self):
- return [self._name]
-
class Pin(object):
def __init__(self, name, port, bit):
@@ -98,15 +95,6 @@ class Pin(object):
hdr_file.write("extern const machine_pin_obj_t pin_{:s}_obj;\n".format(n))
hdr_file.write("#define pin_{:s} (&pin_{:s}_obj)\n".format(n, n))
- def qstr_list(self):
- result = []
- for pin_ad in self._pin_ad:
- result += pin_ad.qstr_list()
- # for alt_fn in self.alt_fn:
- # if alt_fn.is_supported():
- # result += alt_fn.qstr_list()
- return result
-
class NamedPin(object):
def __init__(self, name, pin):
@@ -209,19 +197,6 @@ class Pins(object):
)
)
- def print_qstr(self, qstr_filename):
- with open(qstr_filename, "wt") as qstr_file:
- qstr_set = set([])
- for named_pin in self.cpu_pins:
- pin = named_pin.pin()
- if pin.is_board_pin():
- qstr_set |= set(pin.qstr_list())
- qstr_set |= set([named_pin.name()])
- for named_pin in self.board_pins:
- qstr_set |= set([named_pin.name()])
- for qstr in sorted(qstr_set):
- print("Q({})".format(qstr), file=qstr_file)
-
def print_ad_hdr(self, ad_const_filename):
with open(ad_const_filename, "wt") as ad_const_file:
for named_pin in self.cpu_pins:
@@ -266,12 +241,6 @@ def main():
default="build/pins_ad_const.h",
)
parser.add_argument(
- "--af-const",
- dest="af_const_filename",
- 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.",
@@ -284,13 +253,6 @@ def main():
default="build/pins_af_defs.h",
)
parser.add_argument(
- "-q",
- "--qstr",
- dest="qstr_filename",
- help="Specifies name of generated qstr header file",
- default="build/pins_qstr.h",
- )
- parser.add_argument(
"-r",
"--hdr",
dest="hdr_filename",
@@ -319,7 +281,6 @@ def main():
pins.print()
pins.print_header(args.hdr_filename)
- pins.print_qstr(args.qstr_filename)
pins.print_ad_hdr(args.ad_const_filename)