Browse Source

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>
pull/12211/head
Jim Mussared 1 year ago
committed by Damien George
parent
commit
cb37b7bba7
  1. 2
      ports/cc3200/Makefile
  2. 7
      ports/cc3200/application.mk
  3. 24
      ports/cc3200/boards/make-pins.py

2
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

7
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)

24
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(
@ -228,13 +212,6 @@ def main():
help="Specifies beginning portion of generated pins file",
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",
@ -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)

Loading…
Cancel
Save