summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2023-08-04 23:15:25 +1000
committerDamien George <damien@micropython.org>2023-11-03 14:02:58 +1100
commitcb37b7bba756115029d9b973c753eb4b81be5ab7 (patch)
treed77d4ec44e8f80fa5922f82aeb3cc82b7f5d0b6a
parentdf28aa1a595afcefaa164e61af38b9b17d83fa6b (diff)
cc3200/boards/make-pins.py: Don't generate qstrs.
The output pins.c can be processed for qstrs like any other C file. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
-rw-r--r--ports/cc3200/Makefile2
-rw-r--r--ports/cc3200/application.mk7
-rw-r--r--ports/cc3200/boards/make-pins.py24
3 files changed, 4 insertions, 29 deletions
diff --git a/ports/cc3200/Makefile b/ports/cc3200/Makefile
index f89a927c0..099fa295c 100644
--- a/ports/cc3200/Makefile
+++ b/ports/cc3200/Makefile
@@ -36,7 +36,7 @@ FLASH_SIZE_LAUNCHXL = 1M
ifeq ($(BTARGET), application)
# qstr definitions (must come before including py.mk)
-QSTR_DEFS = qstrdefsport.h $(BUILD)/pins_qstr.h
+QSTR_DEFS = qstrdefsport.h
# MicroPython feature configurations
MICROPY_ROM_TEXT_COMPRESSION ?= 1
diff --git a/ports/cc3200/application.mk b/ports/cc3200/application.mk
index 7a8fb8d94..15a5824c3 100644
--- a/ports/cc3200/application.mk
+++ b/ports/cc3200/application.mk
@@ -164,7 +164,7 @@ OBJ += $(BUILD)/shared/runtime/gchelper_thumb2.o
OBJ += $(BUILD)/pins.o
# List of sources for qstr extraction
-SRC_QSTR += $(APP_MODS_SRC_C) $(APP_MISC_SRC_C) $(APP_STM_SRC_C) $(APP_SHARED_SRC_C) $(APP_HAL_SRC_C)
+SRC_QSTR += $(APP_MODS_SRC_C) $(APP_MISC_SRC_C) $(APP_STM_SRC_C) $(APP_SHARED_SRC_C) $(APP_HAL_SRC_C) $(GEN_PINS_SRC)
# Append any auto-generated sources that are needed by sources listed in
# SRC_QSTR
SRC_QSTR_AUTO_DEPS +=
@@ -228,7 +228,6 @@ AF_FILE = boards/cc3200_af.csv
PREFIX_FILE = boards/cc3200_prefix.c
GEN_PINS_SRC = $(BUILD)/pins.c
GEN_PINS_HDR = $(HEADER_BUILD)/pins.h
-GEN_PINS_QSTR = $(BUILD)/pins_qstr.h
# Making OBJ use an order-only dependency on the generated pins.h file
# has the side effect of making the pins.h file before we actually compile
@@ -238,6 +237,6 @@ GEN_PINS_QSTR = $(BUILD)/pins_qstr.h
$(OBJ): | $(GEN_PINS_HDR)
# Call make-pins.py to generate both pins_gen.c and pins.h
-$(GEN_PINS_SRC) $(GEN_PINS_HDR) $(GEN_PINS_QSTR): $(BOARD_PINS) $(MAKE_PINS) $(AF_FILE) $(PREFIX_FILE) | $(HEADER_BUILD)
+$(GEN_PINS_SRC) $(GEN_PINS_HDR): $(BOARD_PINS) $(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) --qstr $(GEN_PINS_QSTR) > $(GEN_PINS_SRC)
+ $(Q)$(PYTHON) $(MAKE_PINS) --board $(BOARD_PINS) --af $(AF_FILE) --prefix $(PREFIX_FILE) --hdr $(GEN_PINS_HDR) > $(GEN_PINS_SRC)
diff --git a/ports/cc3200/boards/make-pins.py b/ports/cc3200/boards/make-pins.py
index 6608be438..cd4abb93d 100644
--- a/ports/cc3200/boards/make-pins.py
+++ b/ports/cc3200/boards/make-pins.py
@@ -185,22 +185,6 @@ class Pins:
if pin.board_pin:
pin.print_header(hdr_file)
- def print_qstr(self, qstr_filename):
- with open(qstr_filename, "wt") as qstr_file:
- pin_qstr_set = set([])
- af_qstr_set = set([])
- for pin in self.board_pins:
- if pin.board_pin:
- pin_qstr_set |= set([pin.name])
- for af in pin.afs:
- af_qstr_set |= set([af.name])
- print("// Board pins", file=qstr_file)
- for qstr in sorted(pin_qstr_set):
- print("Q({})".format(qstr), file=qstr_file)
- print("\n// Pin AFs", file=qstr_file)
- for qstr in sorted(af_qstr_set):
- print("Q({})".format(qstr), file=qstr_file)
-
def main():
parser = argparse.ArgumentParser(
@@ -229,13 +213,6 @@ def main():
default="cc3200_prefix.c",
)
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",
@@ -262,7 +239,6 @@ def main():
with open(args.prefix_filename, "r") as prefix_file:
print(prefix_file.read())
pins.print()
- pins.print_qstr(args.qstr_filename)
pins.print_header(args.hdr_filename)