mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 01:40:14 +01:00
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:
committed by
Damien George
parent
3f99dbd634
commit
df28aa1a59
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user