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>
This commit is contained in:
parent
3f99dbd634
commit
df28aa1a59
@ -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
|
||||
|
||||
|
@ -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:
|
||||
@ -265,12 +240,6 @@ def main():
|
||||
help="Specifies header file for AD function constants.",
|
||||
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",
|
||||
@ -283,13 +252,6 @@ def main():
|
||||
help="Specifies the filename for the alternate function defines.",
|
||||
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",
|
||||
@ -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)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user