You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
py: Add rules for automated extraction of qstrs from sources.
- add template rule that converts a specified source file into a qstring file - add special rule for generating a central header that contains all extracted/autogenerated strings - defined by QSTR_DEFS_COLLECTED variable. Each platform appends a list of sources that may contain qstrings into a new build variable: SRC_QSTR. Any autogenerated prerequisities are should be appened to SRC_QSTR_AUTO_DEPS variable. - remove most qstrings from py/qstrdefs, keep only qstrings that contain special characters - these cannot be easily detected in the sources without additional annotations - remove most manual qstrdefs, use qstrdef autogen for: py, cc3200, stmhal, teensy, unix, windows, pic16bit: - remove all micropython generic qstrdefs except for the special strings that contain special characters (e.g. /,+,<,> etc.) - remove all port specific qstrdefs except for special strings - append sources for qstr generation in platform makefiles (SRC_QSTR)
This commit is contained in:
@@ -171,6 +171,12 @@ OBJ += $(addprefix $(BUILD)/, $(APP_MODS_SRC_C:.c=.o) $(APP_CC3100_SRC_C:.c=.o)
|
||||
OBJ += $(addprefix $(BUILD)/, $(APP_MAIN_SRC_C:.c=.o) $(APP_LIB_SRC_C:.c=.o) $(APP_STM_SRC_C:.c=.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)
|
||||
# Append any auto-generated sources that are needed by sources listed in
|
||||
# SRC_QSTR
|
||||
SRC_QSTR_AUTO_DEPS +=
|
||||
|
||||
# Add the linker script
|
||||
LINKER_SCRIPT = application.lds
|
||||
LDFLAGS += -T $(LINKER_SCRIPT)
|
||||
|
||||
+1
-361
@@ -26,367 +26,7 @@
|
||||
*/
|
||||
|
||||
// for machine module
|
||||
Q(umachine)
|
||||
#ifdef DEBUG
|
||||
Q(info)
|
||||
#endif
|
||||
Q(reset)
|
||||
Q(main)
|
||||
Q(sync)
|
||||
Q(rng)
|
||||
Q(freq)
|
||||
Q(unique_id)
|
||||
Q(disable_irq)
|
||||
Q(enable_irq)
|
||||
Q(idle)
|
||||
Q(sleep)
|
||||
Q(deepsleep)
|
||||
Q(reset_cause)
|
||||
Q(wake_reason)
|
||||
Q(IDLE)
|
||||
Q(SLEEP)
|
||||
Q(DEEPSLEEP)
|
||||
Q(POWER_ON)
|
||||
Q(HARD_RESET)
|
||||
Q(WDT_RESET)
|
||||
Q(DEEPSLEEP_RESET)
|
||||
Q(SOFT_RESET)
|
||||
Q(WLAN_WAKE)
|
||||
Q(PIN_WAKE)
|
||||
Q(RTC_WAKE)
|
||||
|
||||
// for wipy module
|
||||
Q(wipy)
|
||||
Q(heartbeat)
|
||||
|
||||
Q(/)
|
||||
// entries for sys.path
|
||||
Q(/flash)
|
||||
Q(/flash/lib)
|
||||
|
||||
// interactive help
|
||||
Q(help)
|
||||
|
||||
// for module weak links
|
||||
Q(struct)
|
||||
Q(binascii)
|
||||
Q(re)
|
||||
Q(json)
|
||||
Q(heapq)
|
||||
//Q(hashlib)
|
||||
|
||||
// for os module
|
||||
Q(os)
|
||||
Q(uos)
|
||||
Q(sysname)
|
||||
Q(nodename)
|
||||
Q(release)
|
||||
Q(version)
|
||||
Q(machine)
|
||||
Q(uname)
|
||||
Q(/)
|
||||
Q(flash)
|
||||
Q(chdir)
|
||||
Q(getcwd)
|
||||
Q(listdir)
|
||||
Q(mkdir)
|
||||
Q(rename)
|
||||
Q(remove)
|
||||
Q(rmdir)
|
||||
Q(unlink)
|
||||
Q(sep)
|
||||
Q(stat)
|
||||
Q(urandom)
|
||||
Q(mkfs)
|
||||
Q(mount)
|
||||
Q(unmount)
|
||||
Q(dupterm)
|
||||
Q(readonly)
|
||||
Q(readblocks)
|
||||
Q(writeblocks)
|
||||
Q(sync)
|
||||
Q(count)
|
||||
|
||||
// for file class
|
||||
Q(seek)
|
||||
Q(tell)
|
||||
Q(input)
|
||||
Q(flush)
|
||||
|
||||
// for Pin class
|
||||
Q(Pin)
|
||||
Q(board)
|
||||
Q(init)
|
||||
Q(value)
|
||||
Q(toggle)
|
||||
Q(id)
|
||||
Q(mode)
|
||||
Q(pull)
|
||||
Q(drive)
|
||||
Q(alt)
|
||||
Q(alt_list)
|
||||
Q(IN)
|
||||
Q(OUT)
|
||||
Q(OPEN_DRAIN)
|
||||
Q(ALT)
|
||||
Q(ALT_OPEN_DRAIN)
|
||||
Q(PULL_UP)
|
||||
Q(PULL_DOWN)
|
||||
Q(LOW_POWER)
|
||||
Q(MED_POWER)
|
||||
Q(HIGH_POWER)
|
||||
Q(IRQ_RISING)
|
||||
Q(IRQ_FALLING)
|
||||
Q(IRQ_LOW_LEVEL)
|
||||
Q(IRQ_HIGH_LEVEL)
|
||||
|
||||
// for UART class
|
||||
Q(UART)
|
||||
Q(init)
|
||||
Q(deinit)
|
||||
Q(any)
|
||||
Q(sendbreak)
|
||||
Q(id)
|
||||
Q(baudrate)
|
||||
Q(bits)
|
||||
Q(stop)
|
||||
Q(parity)
|
||||
Q(pins)
|
||||
Q(EVEN)
|
||||
Q(ODD)
|
||||
Q(RX_ANY)
|
||||
|
||||
// for I2C class
|
||||
Q(I2C)
|
||||
Q(id)
|
||||
Q(mode)
|
||||
Q(baudrate)
|
||||
Q(pins)
|
||||
Q(addr)
|
||||
Q(nbytes)
|
||||
Q(buf)
|
||||
Q(stop)
|
||||
Q(memaddr)
|
||||
Q(addrsize)
|
||||
Q(init)
|
||||
Q(deinit)
|
||||
Q(scan)
|
||||
Q(readfrom)
|
||||
Q(readfrom_into)
|
||||
Q(writeto)
|
||||
Q(readfrom_mem)
|
||||
Q(readfrom_mem_into)
|
||||
Q(writeto_mem)
|
||||
Q(MASTER)
|
||||
|
||||
// for ADC class
|
||||
Q(ADC)
|
||||
Q(ADCChannel)
|
||||
Q(value)
|
||||
Q(init)
|
||||
Q(deinit)
|
||||
Q(channel)
|
||||
Q(id)
|
||||
Q(pin)
|
||||
|
||||
// for SD class
|
||||
Q(SD)
|
||||
Q(init)
|
||||
Q(deinit)
|
||||
Q(id)
|
||||
Q(pins)
|
||||
|
||||
// for RTC class
|
||||
Q(RTC)
|
||||
Q(id)
|
||||
Q(init)
|
||||
Q(alarm)
|
||||
Q(alarm_left)
|
||||
Q(alarm_cancel)
|
||||
Q(now)
|
||||
Q(deinit)
|
||||
Q(datetime)
|
||||
Q(repeat)
|
||||
Q(ALARM0)
|
||||
|
||||
// for time class
|
||||
Q(time)
|
||||
Q(utime)
|
||||
Q(localtime)
|
||||
Q(mktime)
|
||||
Q(sleep)
|
||||
Q(sleep_ms)
|
||||
Q(sleep_us)
|
||||
Q(ticks_ms)
|
||||
Q(ticks_us)
|
||||
Q(ticks_cpu)
|
||||
Q(ticks_diff)
|
||||
|
||||
// for select class
|
||||
Q(select)
|
||||
Q(uselect)
|
||||
Q(register)
|
||||
Q(unregister)
|
||||
Q(modify)
|
||||
Q(poll)
|
||||
Q(POLLIN)
|
||||
Q(POLLOUT)
|
||||
Q(POLLERR)
|
||||
Q(POLLHUP)
|
||||
|
||||
// for socket class
|
||||
Q(socket)
|
||||
Q(usocket)
|
||||
Q(getaddrinfo)
|
||||
Q(family)
|
||||
Q(type)
|
||||
Q(send)
|
||||
Q(sendall)
|
||||
Q(sendto)
|
||||
Q(recv)
|
||||
Q(recvfrom)
|
||||
Q(listen)
|
||||
Q(accept)
|
||||
Q(bind)
|
||||
Q(settimeout)
|
||||
Q(setblocking)
|
||||
Q(setsockopt)
|
||||
Q(close)
|
||||
Q(makefile)
|
||||
Q(protocol)
|
||||
Q(error)
|
||||
Q(timeout)
|
||||
Q(AF_INET)
|
||||
Q(SOCK_STREAM)
|
||||
Q(SOCK_DGRAM)
|
||||
Q(IPPROTO_SEC)
|
||||
Q(IPPROTO_TCP)
|
||||
Q(IPPROTO_UDP)
|
||||
|
||||
// for ssl class
|
||||
Q(ssl)
|
||||
Q(ussl)
|
||||
Q(wrap_socket)
|
||||
Q(sock)
|
||||
Q(keyfile)
|
||||
Q(certfile)
|
||||
Q(server_side)
|
||||
Q(cert_reqs)
|
||||
Q(ca_certs)
|
||||
Q(SSLError)
|
||||
Q(CERT_NONE)
|
||||
Q(CERT_OPTIONAL)
|
||||
Q(CERT_REQUIRED)
|
||||
|
||||
// for network class
|
||||
Q(network)
|
||||
Q(Server)
|
||||
Q(init)
|
||||
Q(deinit)
|
||||
Q(login)
|
||||
Q(timeout)
|
||||
Q(isrunning)
|
||||
|
||||
// for WLAN class
|
||||
Q(WLAN)
|
||||
Q(id)
|
||||
Q(init)
|
||||
Q(mode)
|
||||
Q(auth)
|
||||
Q(ssid)
|
||||
Q(bssid)
|
||||
Q(mac)
|
||||
Q(antenna)
|
||||
Q(scan)
|
||||
Q(connect)
|
||||
Q(isconnected)
|
||||
Q(disconnect)
|
||||
Q(sec)
|
||||
Q(channel)
|
||||
Q(rssi)
|
||||
Q(ifconfig)
|
||||
Q(config)
|
||||
//Q(connections)
|
||||
//Q(urn)
|
||||
Q(STA)
|
||||
Q(AP)
|
||||
Q(OPEN)
|
||||
Q(WEP)
|
||||
Q(WPA)
|
||||
Q(WPA2)
|
||||
Q(INT_ANT)
|
||||
Q(EXT_ANT)
|
||||
Q(ANY_EVENT)
|
||||
|
||||
// for WDT class
|
||||
Q(WDT)
|
||||
Q(feed)
|
||||
Q(timeout)
|
||||
|
||||
// for irq class
|
||||
Q(irq)
|
||||
Q(init)
|
||||
Q(enable)
|
||||
Q(disable)
|
||||
Q(flags)
|
||||
Q(trigger)
|
||||
Q(handler)
|
||||
Q(priority)
|
||||
Q(wake)
|
||||
|
||||
// for SPI class
|
||||
Q(SPI)
|
||||
Q(id)
|
||||
Q(mode)
|
||||
Q(baudrate)
|
||||
Q(bits)
|
||||
Q(polarity)
|
||||
Q(phase)
|
||||
Q(firstbit)
|
||||
Q(init)
|
||||
Q(deinit)
|
||||
Q(write)
|
||||
Q(read)
|
||||
Q(readinto)
|
||||
Q(write_readinto)
|
||||
Q(nbytes)
|
||||
Q(buf)
|
||||
Q(MASTER)
|
||||
Q(MSB)
|
||||
|
||||
// for Timer class
|
||||
Q(Timer)
|
||||
Q(TimerChannel)
|
||||
Q(init)
|
||||
Q(deinit)
|
||||
Q(freq)
|
||||
Q(period)
|
||||
Q(mode)
|
||||
Q(width)
|
||||
Q(channel)
|
||||
Q(polarity)
|
||||
Q(duty_cycle)
|
||||
Q(A)
|
||||
Q(B)
|
||||
Q(ONE_SHOT)
|
||||
Q(PERIODIC)
|
||||
Q(PWM)
|
||||
Q(POSITIVE)
|
||||
Q(NEGATIVE)
|
||||
Q(TIMEOUT)
|
||||
Q(MATCH)
|
||||
|
||||
// for uhashlib module
|
||||
//Q(uhashlib)
|
||||
//Q(update)
|
||||
//Q(digest)
|
||||
//Q(md5)
|
||||
//Q(sha1)
|
||||
//Q(sha256)
|
||||
|
||||
// for ubinascii module
|
||||
Q(ubinascii)
|
||||
Q(hexlify)
|
||||
Q(unhexlify)
|
||||
Q(a2b_base64)
|
||||
Q(b2a_base64)
|
||||
|
||||
|
||||
@@ -49,6 +49,12 @@ SRC_S = \
|
||||
|
||||
OBJ = $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o) $(SRC_S:.s=.o))
|
||||
|
||||
# List of sources for qstr extraction
|
||||
SRC_QSTR += $(SRC_C)
|
||||
# Append any auto-generated sources that are needed by sources listed in
|
||||
# SRC_QSTR
|
||||
SRC_QSTR_AUTO_DEPS +=
|
||||
|
||||
all: $(BUILD)/firmware.hex
|
||||
|
||||
$(BUILD)/firmware.hex: $(BUILD)/firmware.elf
|
||||
|
||||
@@ -1,17 +1 @@
|
||||
// qstrs specific to this port
|
||||
|
||||
Q(pyb)
|
||||
Q(millis)
|
||||
Q(elapsed_millis)
|
||||
Q(delay)
|
||||
Q(LED)
|
||||
Q(on)
|
||||
Q(off)
|
||||
Q(toggle)
|
||||
Q(Switch)
|
||||
Q(value)
|
||||
Q(readall)
|
||||
Q(readinto)
|
||||
Q(readline)
|
||||
Q(readlines)
|
||||
Q(FileIO)
|
||||
|
||||
@@ -46,10 +46,30 @@ vpath %.c . $(TOP)
|
||||
$(BUILD)/%.o: %.c
|
||||
$(call compile_c)
|
||||
|
||||
# A empty qstrdefs header is needed to properly preprocess every file
|
||||
EMPTY_QSTRDEFS_GENERATED_H = $(BUILD)/tmp/genhdr/qstrdefs.generated.h
|
||||
|
||||
# List all native flags since the current build system doesn't have
|
||||
# the micropython configuration available. However, these flags are
|
||||
# needed to extract all qstrings
|
||||
QSTR_GEN_EXTRA_CFLAGS += -DN_X64 -DN_X86 -DN_THUMB -DN_ARM
|
||||
QSTR_GEN_EXTRA_CFLAGS += -I$(BUILD)/tmp
|
||||
|
||||
vpath %.c . $(TOP)
|
||||
$(HEADER_BUILD)/%.qstr: % | $(EMPTY_QSTRDEFS_GENERATED_H) $(HEADER_BUILD)/mpversion.h $(SRC_QSTR_AUTO_DEPS)
|
||||
@mkdir -p $(dir $@);
|
||||
$(Q)$(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) $< -o - | $(PYTHON) $(PY_SRC)/makeqstrdefs.py -s -o $@
|
||||
|
||||
|
||||
$(BUILD)/%.pp: %.c
|
||||
$(ECHO) "PreProcess $<"
|
||||
$(Q)$(CC) $(CFLAGS) -E -Wp,-C,-dD,-dI -o $@ $<
|
||||
|
||||
$(EMPTY_QSTRDEFS_GENERATED_H):
|
||||
$(ECHO) "Generate empty $@ to satisfy qstr generator"
|
||||
$(Q)mkdir -p $(dir $@)
|
||||
$(Q)touch $@
|
||||
|
||||
# The following rule uses | to create an order only prereuisite. Order only
|
||||
# prerequisites only get built if they don't exist. They don't cause timestamp
|
||||
# checking to be performed.
|
||||
@@ -61,6 +81,14 @@ $(BUILD)/%.pp: %.c
|
||||
# to get built before we try to compile any of them.
|
||||
$(OBJ): | $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/mpversion.h
|
||||
|
||||
# This rule joins all generated qstr files
|
||||
$(QSTR_DEFS_COLLECTED): $(addprefix $(HEADER_BUILD)/,$(addsuffix .qstr,$(SRC_QSTR))) $(PY_SRC)/mpconfig.h
|
||||
$(ECHO) "GEN $@"
|
||||
$(Q)cat $^ > $@
|
||||
|
||||
|
||||
#
|
||||
|
||||
# $(sort $(var)) removes duplicates
|
||||
#
|
||||
# The net effect of this, is it causes the objects to depend on the
|
||||
|
||||
@@ -7,6 +7,9 @@ HEADER_BUILD = $(BUILD)/genhdr
|
||||
# file containing qstr defs for the core Python bit
|
||||
PY_QSTR_DEFS = $(PY_SRC)/qstrdefs.h
|
||||
|
||||
# All collected qstr defs
|
||||
QSTR_DEFS_COLLECTED = $(HEADER_BUILD)/qstrdefs.collected.h
|
||||
|
||||
# some code is performance bottleneck and compiled with other optimization options
|
||||
CSUPEROPT = -O3
|
||||
|
||||
@@ -184,6 +187,10 @@ PY_O_BASENAME = \
|
||||
# prepend the build destination prefix to the py object files
|
||||
PY_O = $(addprefix $(PY_BUILD)/, $(PY_O_BASENAME))
|
||||
|
||||
# Sources that may contain qstrings
|
||||
SRC_QSTR_IGNORE = nlr% emitnx% emitnthumb% emitnarm%
|
||||
SRC_QSTR = $(SRC_MOD) $(addprefix py/,$(filter-out $(SRC_QSTR_IGNORE),$(PY_O_BASENAME:.o=.c)) emitnative.c)
|
||||
|
||||
# Anything that depends on FORCE will be considered out-of-date
|
||||
FORCE:
|
||||
.PHONY: FORCE
|
||||
@@ -196,14 +203,13 @@ $(HEADER_BUILD)/mpversion.h: FORCE | $(HEADER_BUILD)
|
||||
MPCONFIGPORT_MK = $(wildcard mpconfigport.mk)
|
||||
|
||||
# qstr data
|
||||
|
||||
# Adding an order only dependency on $(HEADER_BUILD) causes $(HEADER_BUILD) to get
|
||||
# created before we run the script to generate the .h
|
||||
# Note: we need to protect the qstr names from the preprocessor, so we wrap
|
||||
# the lines in "" and then unwrap after the preprocessor is finished.
|
||||
$(HEADER_BUILD)/qstrdefs.generated.h: $(PY_QSTR_DEFS) $(QSTR_DEFS) $(PY_SRC)/makeqstrdata.py mpconfigport.h $(MPCONFIGPORT_MK) $(PY_SRC)/mpconfig.h | $(HEADER_BUILD)
|
||||
$(HEADER_BUILD)/qstrdefs.generated.h: $(PY_QSTR_DEFS) $(QSTR_DEFS) $(QSTR_DEFS_COLLECTED) $(PY_SRC)/makeqstrdata.py mpconfigport.h $(MPCONFIGPORT_MK) $(PY_SRC)/mpconfig.h | $(HEADER_BUILD)
|
||||
$(ECHO) "GEN $@"
|
||||
$(Q)cat $(PY_QSTR_DEFS) $(QSTR_DEFS) | $(SED) 's/^Q(.*)/"&"/' | $(CPP) $(CFLAGS) - | sed 's/^"\(Q(.*)\)"/\1/' > $(HEADER_BUILD)/qstrdefs.preprocessed.h
|
||||
$(Q)cat $(PY_QSTR_DEFS) $(QSTR_DEFS) $(QSTR_DEFS_COLLECTED) | $(SED) 's/^Q(.*)/"&"/' | $(CPP) $(CFLAGS) - | sed 's/^"\(Q(.*)\)"/\1/' > $(HEADER_BUILD)/qstrdefs.preprocessed.h
|
||||
$(Q)$(PYTHON) $(PY_SRC)/makeqstrdata.py $(HEADER_BUILD)/qstrdefs.preprocessed.h > $@
|
||||
|
||||
# emitters
|
||||
|
||||
+9
-753
File diff suppressed because it is too large
Load Diff
@@ -353,6 +353,12 @@ CDCINF_TEMPLATE = pybcdc.inf_template
|
||||
GEN_CDCINF_FILE = $(HEADER_BUILD)/pybcdc.inf
|
||||
GEN_CDCINF_HEADER = $(HEADER_BUILD)/pybcdc_inf.h
|
||||
|
||||
# List of sources for qstr extraction
|
||||
SRC_QSTR += $(SRC_C) $(SRC_MOD) $(SRC_LIB)
|
||||
# Append any auto-generated sources that are needed by sources listed in
|
||||
# SRC_QSTR
|
||||
SRC_QSTR_AUTO_DEPS += $(GEN_CDCINF_HEADER)
|
||||
|
||||
# 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
|
||||
# any of the objects. The normal dependency generation will deal with the
|
||||
|
||||
+4
-457
@@ -26,46 +26,6 @@
|
||||
|
||||
// qstrs specific to this port
|
||||
|
||||
Q(help)
|
||||
Q(pyb)
|
||||
Q(umachine)
|
||||
Q(unique_id)
|
||||
Q(bootloader)
|
||||
Q(hard_reset)
|
||||
Q(info)
|
||||
Q(sd_test)
|
||||
Q(present)
|
||||
Q(power)
|
||||
Q(wfi)
|
||||
Q(disable_irq)
|
||||
Q(enable_irq)
|
||||
Q(reset)
|
||||
Q(irq_stats)
|
||||
Q(stop)
|
||||
Q(standby)
|
||||
Q(idle)
|
||||
Q(deepsleep)
|
||||
Q(main)
|
||||
Q(opt)
|
||||
Q(sync)
|
||||
Q(gc)
|
||||
Q(repl_info)
|
||||
Q(delay)
|
||||
Q(udelay)
|
||||
Q(servo)
|
||||
Q(pwm)
|
||||
Q(read)
|
||||
Q(readall)
|
||||
Q(readline)
|
||||
Q(write)
|
||||
Q(repl_uart)
|
||||
Q(time)
|
||||
Q(rng)
|
||||
Q(Flash)
|
||||
Q(SD)
|
||||
Q(SDCard)
|
||||
Q(FileIO)
|
||||
Q(flush)
|
||||
Q(boot.py)
|
||||
Q(main.py)
|
||||
// Entries for sys.path
|
||||
@@ -73,428 +33,15 @@ Q(/flash)
|
||||
Q(/flash/lib)
|
||||
Q(/sd)
|
||||
Q(/sd/lib)
|
||||
Q(millis)
|
||||
Q(micros)
|
||||
Q(elapsed_millis)
|
||||
Q(elapsed_micros)
|
||||
|
||||
// for module weak links
|
||||
Q(binascii)
|
||||
Q(re)
|
||||
Q(zlib)
|
||||
Q(json)
|
||||
Q(heapq)
|
||||
Q(hashlib)
|
||||
|
||||
// for USB configuration
|
||||
Q(usb_mode)
|
||||
Q(mode)
|
||||
Q(vid)
|
||||
Q(pid)
|
||||
Q(hid)
|
||||
Q(hid_mouse)
|
||||
Q(hid_keyboard)
|
||||
|
||||
// for usb modes
|
||||
Q(host)
|
||||
Q(VCP)
|
||||
Q(MSC)
|
||||
Q(HID)
|
||||
Q(MSC+HID)
|
||||
Q(VCP+MSC)
|
||||
Q(VCP+HID)
|
||||
// CDC is a synonym for VCP for backwards compatibility
|
||||
Q(CDC)
|
||||
Q(CDC+MSC)
|
||||
Q(CDC+HID)
|
||||
|
||||
// for USB VCP class
|
||||
Q(USB_VCP)
|
||||
Q(setinterrupt)
|
||||
Q(isconnected)
|
||||
Q(have_cdc)
|
||||
Q(any)
|
||||
Q(send)
|
||||
Q(recv)
|
||||
Q(timeout)
|
||||
|
||||
// for USB HID class
|
||||
Q(USB_HID)
|
||||
Q(any)
|
||||
Q(send)
|
||||
Q(recv)
|
||||
|
||||
// for RTC class
|
||||
Q(RTC)
|
||||
Q(info)
|
||||
Q(datetime)
|
||||
Q(wakeup)
|
||||
Q(calibration)
|
||||
|
||||
// for Pin class
|
||||
Q(Pin)
|
||||
Q(PinAF)
|
||||
Q(PinNamed)
|
||||
Q(init)
|
||||
Q(value)
|
||||
Q(alt)
|
||||
Q(low)
|
||||
Q(high)
|
||||
Q(name)
|
||||
Q(names)
|
||||
Q(af)
|
||||
Q(af_list)
|
||||
Q(port)
|
||||
Q(pin)
|
||||
Q(gpio)
|
||||
Q(mapper)
|
||||
Q(dict)
|
||||
Q(debug)
|
||||
Q(board)
|
||||
Q(cpu)
|
||||
Q(af)
|
||||
Q(mode)
|
||||
Q(pull)
|
||||
Q(index)
|
||||
Q(reg)
|
||||
Q(IN)
|
||||
Q(OUT)
|
||||
Q(OPEN_DRAIN)
|
||||
Q(ALT)
|
||||
Q(ALT_OPEN_DRAIN)
|
||||
Q(ANALOG)
|
||||
Q(PULL_UP)
|
||||
Q(PULL_DOWN)
|
||||
Q(OUT_PP)
|
||||
Q(OUT_OD)
|
||||
Q(AF_PP)
|
||||
Q(AF_OD)
|
||||
Q(PULL_NONE)
|
||||
|
||||
// for LED object
|
||||
Q(LED)
|
||||
Q(on)
|
||||
Q(off)
|
||||
Q(toggle)
|
||||
Q(intensity)
|
||||
|
||||
// for Switch class
|
||||
Q(Switch)
|
||||
Q(callback)
|
||||
|
||||
// for UART class
|
||||
Q(UART)
|
||||
Q(baudrate)
|
||||
Q(bits)
|
||||
Q(stop)
|
||||
Q(parity)
|
||||
Q(flow)
|
||||
Q(read_buf_len)
|
||||
Q(buf)
|
||||
Q(len)
|
||||
Q(timeout)
|
||||
Q(timeout_char)
|
||||
Q(init)
|
||||
Q(deinit)
|
||||
Q(any)
|
||||
Q(writechar)
|
||||
Q(readchar)
|
||||
Q(readinto)
|
||||
Q(sendbreak)
|
||||
Q(RTS)
|
||||
Q(CTS)
|
||||
|
||||
// for CAN class
|
||||
#if MICROPY_HW_ENABLE_CAN
|
||||
Q(CAN)
|
||||
Q(prescaler)
|
||||
Q(init)
|
||||
Q(deinit)
|
||||
Q(all)
|
||||
Q(send)
|
||||
Q(recv)
|
||||
Q(addr)
|
||||
Q(fifo)
|
||||
Q(timeout)
|
||||
Q(extframe)
|
||||
Q(sjw)
|
||||
Q(bs1)
|
||||
Q(bs2)
|
||||
Q(bank)
|
||||
Q(params)
|
||||
Q(initfilterbanks)
|
||||
Q(clearfilter)
|
||||
Q(setfilter)
|
||||
Q(rxcallback)
|
||||
Q(rtr)
|
||||
Q(NORMAL)
|
||||
Q(LOOPBACK)
|
||||
Q(SILENT)
|
||||
Q(SILENT_LOOPBACK)
|
||||
Q(MASK16)
|
||||
Q(LIST16)
|
||||
Q(MASK32)
|
||||
Q(LIST32)
|
||||
#endif
|
||||
|
||||
// for Timer class
|
||||
Q(Timer)
|
||||
Q(init)
|
||||
Q(deinit)
|
||||
Q(channel)
|
||||
Q(counter)
|
||||
Q(source_freq)
|
||||
Q(prescaler)
|
||||
Q(period)
|
||||
Q(callback)
|
||||
Q(freq)
|
||||
Q(mode)
|
||||
Q(div)
|
||||
Q(UP)
|
||||
Q(DOWN)
|
||||
Q(CENTER)
|
||||
Q(IC)
|
||||
Q(PWM)
|
||||
Q(PWM_INVERTED)
|
||||
Q(OC_TIMING)
|
||||
Q(OC_ACTIVE)
|
||||
Q(OC_INACTIVE)
|
||||
Q(OC_TOGGLE)
|
||||
Q(OC_FORCED_ACTIVE)
|
||||
Q(OC_FORCED_INACTIVE)
|
||||
Q(ENC_A)
|
||||
Q(ENC_B)
|
||||
Q(ENC_AB)
|
||||
Q(HIGH)
|
||||
Q(LOW)
|
||||
Q(RISING)
|
||||
Q(FALLING)
|
||||
Q(BOTH)
|
||||
|
||||
// for TimerChannel class
|
||||
Q(TimerChannel)
|
||||
Q(pulse_width)
|
||||
Q(pulse_width_percent)
|
||||
Q(compare)
|
||||
Q(capture)
|
||||
Q(polarity)
|
||||
Q(deadtime)
|
||||
|
||||
// for ExtInt class
|
||||
Q(ExtInt)
|
||||
Q(pin)
|
||||
Q(mode)
|
||||
Q(pull)
|
||||
Q(callback)
|
||||
Q(line)
|
||||
Q(enable)
|
||||
Q(disable)
|
||||
Q(swint)
|
||||
Q(regs)
|
||||
Q(IRQ_RISING)
|
||||
Q(IRQ_FALLING)
|
||||
Q(IRQ_RISING_FALLING)
|
||||
Q(EVT_RISING)
|
||||
Q(EVT_FALLING)
|
||||
Q(EVT_RISING_FALLING)
|
||||
|
||||
// for I2C object
|
||||
Q(I2C)
|
||||
Q(mode)
|
||||
Q(addr)
|
||||
Q(baudrate)
|
||||
Q(gencall)
|
||||
Q(data)
|
||||
Q(memaddr)
|
||||
Q(addr_size)
|
||||
Q(timeout)
|
||||
Q(init)
|
||||
Q(deinit)
|
||||
Q(is_ready)
|
||||
Q(scan)
|
||||
Q(send)
|
||||
Q(recv)
|
||||
Q(mem_read)
|
||||
Q(mem_write)
|
||||
|
||||
// for SPI class
|
||||
Q(SPI)
|
||||
Q(init)
|
||||
Q(deinit)
|
||||
Q(send)
|
||||
Q(recv)
|
||||
Q(send_recv)
|
||||
Q(mode)
|
||||
Q(baudrate)
|
||||
Q(polarity)
|
||||
Q(phase)
|
||||
Q(dir)
|
||||
Q(bits)
|
||||
Q(nss)
|
||||
Q(firstbit)
|
||||
Q(ti)
|
||||
Q(crc)
|
||||
Q(MASTER)
|
||||
Q(SLAVE)
|
||||
Q(MSB)
|
||||
Q(LSB)
|
||||
|
||||
// for Accel object
|
||||
Q(Accel)
|
||||
Q(x)
|
||||
Q(y)
|
||||
Q(z)
|
||||
Q(tilt)
|
||||
Q(filtered_xyz)
|
||||
|
||||
// for ADC object
|
||||
Q(ADC)
|
||||
Q(ADCAll)
|
||||
Q(read_timed)
|
||||
Q(read_channel)
|
||||
Q(read_core_temp)
|
||||
Q(read_core_vbat)
|
||||
Q(read_core_vref)
|
||||
|
||||
// for DAC class
|
||||
Q(DAC)
|
||||
Q(noise)
|
||||
Q(triangle)
|
||||
Q(write)
|
||||
Q(write_timed)
|
||||
Q(data)
|
||||
Q(freq)
|
||||
Q(mode)
|
||||
Q(NORMAL)
|
||||
Q(CIRCULAR)
|
||||
|
||||
// for Servo object
|
||||
Q(Servo)
|
||||
Q(pulse_width)
|
||||
Q(calibration)
|
||||
Q(angle)
|
||||
Q(speed)
|
||||
|
||||
// for os module
|
||||
Q(uos)
|
||||
Q(os)
|
||||
Q(/)
|
||||
|
||||
|
||||
// The following qstrings not referenced from anywhere in the sources
|
||||
Q(CDC)
|
||||
Q(flash)
|
||||
Q(sd)
|
||||
Q(sysname)
|
||||
Q(nodename)
|
||||
Q(release)
|
||||
Q(version)
|
||||
Q(machine)
|
||||
Q(uname)
|
||||
Q(chdir)
|
||||
Q(getcwd)
|
||||
Q(listdir)
|
||||
Q(mkdir)
|
||||
Q(rename)
|
||||
Q(remove)
|
||||
Q(rmdir)
|
||||
Q(unlink)
|
||||
Q(sep)
|
||||
Q(stat)
|
||||
Q(statvfs)
|
||||
Q(urandom)
|
||||
Q(dupterm)
|
||||
|
||||
// for time module
|
||||
Q(utime)
|
||||
Q(time)
|
||||
Q(localtime)
|
||||
Q(mktime)
|
||||
Q(sleep)
|
||||
Q(sleep_ms)
|
||||
Q(sleep_us)
|
||||
Q(ticks_ms)
|
||||
Q(ticks_us)
|
||||
Q(ticks_cpu)
|
||||
Q(ticks_diff)
|
||||
|
||||
// for select module
|
||||
Q(uselect)
|
||||
Q(select)
|
||||
Q(poll)
|
||||
Q(register)
|
||||
Q(unregister)
|
||||
Q(modify)
|
||||
Q(POLLIN)
|
||||
Q(POLLOUT)
|
||||
Q(POLLERR)
|
||||
Q(POLLHUP)
|
||||
|
||||
// for input
|
||||
Q(input)
|
||||
|
||||
// for LCD class
|
||||
Q(LCD)
|
||||
Q(command)
|
||||
Q(contrast)
|
||||
Q(light)
|
||||
Q(fill)
|
||||
Q(get)
|
||||
Q(pixel)
|
||||
Q(text)
|
||||
Q(show)
|
||||
|
||||
// for usocket module
|
||||
Q(usocket)
|
||||
Q(socket)
|
||||
Q(getaddrinfo)
|
||||
Q(bind)
|
||||
Q(listen)
|
||||
Q(accept)
|
||||
Q(connect)
|
||||
Q(send)
|
||||
Q(recv)
|
||||
Q(sendto)
|
||||
Q(recvfrom)
|
||||
Q(setblocking)
|
||||
Q(setsockopt)
|
||||
Q(settimeout)
|
||||
Q(close)
|
||||
Q(AF_INET)
|
||||
Q(AF_INET6)
|
||||
Q(SOCK_STREAM)
|
||||
Q(SOCK_DGRAM)
|
||||
Q(SOCK_RAW)
|
||||
|
||||
// for network module
|
||||
Q(network)
|
||||
Q(route)
|
||||
|
||||
// for WIZNET5K class
|
||||
#if MICROPY_PY_WIZNET5K
|
||||
Q(WIZNET5K)
|
||||
Q(regs)
|
||||
Q(ifconfig)
|
||||
Q(ipaddr)
|
||||
#endif
|
||||
|
||||
// for CC3K class
|
||||
#if MICROPY_PY_CC3K
|
||||
Q(CC3K)
|
||||
Q(connect)
|
||||
Q(disconnect)
|
||||
Q(isconnected)
|
||||
Q(ifconfig)
|
||||
Q(patch_version)
|
||||
Q(patch_program)
|
||||
Q(WEP)
|
||||
Q(WPA)
|
||||
Q(WPA2)
|
||||
Q(ssid)
|
||||
Q(key)
|
||||
Q(security)
|
||||
Q(bssid)
|
||||
#endif
|
||||
|
||||
// for stm module
|
||||
Q(stm)
|
||||
Q(mem)
|
||||
Q(mem8)
|
||||
Q(mem16)
|
||||
Q(mem32)
|
||||
|
||||
@@ -218,6 +218,12 @@ GEN_PINS_QSTR = $(BUILD)/pins_qstr.h
|
||||
GEN_PINS_AF_CONST = $(HEADER_BUILD)/pins_af_const.h
|
||||
GEN_PINS_AF_PY = $(BUILD)/pins_af.py
|
||||
|
||||
# List of sources for qstr extraction
|
||||
SRC_QSTR += $(SRC_C) $(STM_SRC_C)
|
||||
# Append any auto-generated sources that are needed by sources listed in
|
||||
# SRC_QSTR
|
||||
SRC_QSTR_AUTO_DEPS +=
|
||||
|
||||
# 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
|
||||
# any of the objects. The normal dependency generation will deal with the
|
||||
|
||||
@@ -1,149 +1 @@
|
||||
// qstrs specific to this port
|
||||
|
||||
Q(help)
|
||||
Q(pyb)
|
||||
Q(info)
|
||||
Q(sd_test)
|
||||
Q(stop)
|
||||
Q(standby)
|
||||
Q(source_dir)
|
||||
Q(main)
|
||||
Q(sync)
|
||||
Q(gc)
|
||||
Q(delay)
|
||||
Q(switch)
|
||||
Q(servo)
|
||||
Q(pwm)
|
||||
Q(accel)
|
||||
Q(mma_read)
|
||||
Q(mma_mode)
|
||||
Q(hid)
|
||||
Q(time)
|
||||
Q(rand)
|
||||
Q(LED)
|
||||
Q(led)
|
||||
Q(Servo)
|
||||
Q(I2C)
|
||||
Q(gpio)
|
||||
Q(Usart)
|
||||
Q(ADC)
|
||||
Q(open)
|
||||
Q(analogRead)
|
||||
Q(analogWrite)
|
||||
Q(analogWriteResolution)
|
||||
Q(analogWriteFrequency)
|
||||
Q(on)
|
||||
Q(off)
|
||||
Q(toggle)
|
||||
Q(readall)
|
||||
Q(readinto)
|
||||
Q(readline)
|
||||
Q(readlines)
|
||||
Q(FileIO)
|
||||
Q(input)
|
||||
Q(os)
|
||||
Q(bootloader)
|
||||
Q(unique_id)
|
||||
Q(freq)
|
||||
Q(repl_info)
|
||||
Q(wfi)
|
||||
Q(disable_irq)
|
||||
Q(enable_irq)
|
||||
Q(usb_mode)
|
||||
Q(have_cdc)
|
||||
Q(millis)
|
||||
Q(micros)
|
||||
Q(elapsed_millis)
|
||||
Q(elapsed_micros)
|
||||
Q(udelay)
|
||||
Q(UART)
|
||||
|
||||
// for Pin class
|
||||
Q(Pin)
|
||||
Q(PinAF)
|
||||
Q(PinNamed)
|
||||
Q(init)
|
||||
Q(value)
|
||||
Q(alt)
|
||||
Q(low)
|
||||
Q(high)
|
||||
Q(name)
|
||||
Q(names)
|
||||
Q(af)
|
||||
Q(af_list)
|
||||
Q(port)
|
||||
Q(pin)
|
||||
Q(gpio)
|
||||
Q(mapper)
|
||||
Q(dict)
|
||||
Q(debug)
|
||||
Q(board)
|
||||
Q(cpu)
|
||||
Q(mode)
|
||||
Q(pull)
|
||||
Q(index)
|
||||
Q(reg)
|
||||
Q(IN)
|
||||
Q(OUT)
|
||||
Q(OPEN_DRAIN)
|
||||
Q(ALT)
|
||||
Q(ALT_OPEN_DRAIN)
|
||||
Q(ANALOG)
|
||||
Q(PULL_UP)
|
||||
Q(PULL_DOWN)
|
||||
Q(OUT_PP)
|
||||
Q(OUT_OD)
|
||||
Q(AF_PP)
|
||||
Q(AF_OD)
|
||||
Q(PULL_NONE)
|
||||
|
||||
// for Timer class
|
||||
Q(Timer)
|
||||
Q(init)
|
||||
Q(deinit)
|
||||
Q(channel)
|
||||
Q(counter)
|
||||
Q(prescaler)
|
||||
Q(period)
|
||||
Q(callback)
|
||||
Q(freq)
|
||||
Q(mode)
|
||||
Q(reg)
|
||||
Q(UP)
|
||||
Q(CENTER)
|
||||
Q(IC)
|
||||
Q(PWM)
|
||||
Q(PWM_INVERTED)
|
||||
Q(OC_TIMING)
|
||||
Q(OC_ACTIVE)
|
||||
Q(OC_INACTIVE)
|
||||
Q(OC_TOGGLE)
|
||||
Q(OC_FORCED_ACTIVE)
|
||||
Q(OC_FORCED_INACTIVE)
|
||||
Q(HIGH)
|
||||
Q(LOW)
|
||||
Q(RISING)
|
||||
Q(FALLING)
|
||||
Q(BOTH)
|
||||
|
||||
// for TimerChannel class
|
||||
Q(TimerChannel)
|
||||
Q(pulse_width)
|
||||
Q(pulse_width_percent)
|
||||
Q(compare)
|
||||
Q(capture)
|
||||
Q(polarity)
|
||||
t
|
||||
// for UART class
|
||||
Q(UART)
|
||||
Q(baudrate)
|
||||
Q(bits)
|
||||
Q(stop)
|
||||
Q(parity)
|
||||
Q(init)
|
||||
Q(deinit)
|
||||
Q(all)
|
||||
Q(send)
|
||||
Q(recv)
|
||||
Q(timeout)
|
||||
|
||||
|
||||
@@ -170,6 +170,13 @@ OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
|
||||
OBJ += $(addprefix $(BUILD)/, $(LIB_SRC_C:.c=.o))
|
||||
OBJ += $(addprefix $(BUILD)/, $(STMHAL_SRC_C:.c=.o))
|
||||
|
||||
# List of sources for qstr extraction
|
||||
SRC_QSTR += $(SRC_C) $(LIB_SRC_C)
|
||||
# Append any auto-generated sources that are needed by sources listed in
|
||||
# SRC_QSTR
|
||||
SRC_QSTR_AUTO_DEPS +=
|
||||
|
||||
|
||||
include ../py/mkrules.mk
|
||||
|
||||
.PHONY: test
|
||||
|
||||
@@ -23,127 +23,3 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// qstrs specific to this port
|
||||
|
||||
Q(Test)
|
||||
|
||||
Q(fileno)
|
||||
Q(makefile)
|
||||
Q(buffering)
|
||||
|
||||
Q(FileIO)
|
||||
Q(flush)
|
||||
|
||||
Q(uos)
|
||||
Q(stat)
|
||||
#if MICROPY_PY_OS_STATVFS
|
||||
Q(statvfs)
|
||||
#endif
|
||||
Q(system)
|
||||
Q(unlink)
|
||||
Q(getenv)
|
||||
Q(mkdir)
|
||||
Q(ilistdir)
|
||||
Q(errno)
|
||||
#if MICROPY_FSUSERMOUNT
|
||||
Q(vfs_mount)
|
||||
Q(vfs_umount)
|
||||
Q(vfs_mkfs)
|
||||
#endif
|
||||
#if MICROPY_VFS_FAT
|
||||
Q(VfsFat)
|
||||
#endif
|
||||
#if MICROPY_PY_OS_DUPTERM
|
||||
Q(dupterm)
|
||||
#endif
|
||||
|
||||
Q(uselect)
|
||||
Q(poll)
|
||||
Q(register)
|
||||
Q(unregister)
|
||||
Q(modify)
|
||||
Q(POLLIN)
|
||||
Q(POLLOUT)
|
||||
Q(POLLERR)
|
||||
Q(POLLHUP)
|
||||
|
||||
Q(ffi)
|
||||
Q(ffimod)
|
||||
Q(ffifunc)
|
||||
Q(fficallback)
|
||||
Q(ffivar)
|
||||
Q(as_bytearray)
|
||||
Q(callback)
|
||||
Q(addr)
|
||||
Q(func)
|
||||
Q(var)
|
||||
Q(get)
|
||||
Q(set)
|
||||
|
||||
Q(input)
|
||||
Q(utime)
|
||||
Q(time)
|
||||
Q(clock)
|
||||
Q(sleep)
|
||||
Q(sleep_ms)
|
||||
Q(sleep_us)
|
||||
Q(ticks_ms)
|
||||
Q(ticks_us)
|
||||
Q(ticks_diff)
|
||||
Q(strftime)
|
||||
|
||||
Q(socket)
|
||||
Q(sockaddr)
|
||||
Q(htons)
|
||||
Q(inet_pton)
|
||||
Q(inet_ntop)
|
||||
Q(gethostbyname)
|
||||
Q(getaddrinfo)
|
||||
Q(usocket)
|
||||
Q(connect)
|
||||
Q(bind)
|
||||
Q(listen)
|
||||
Q(accept)
|
||||
Q(recv)
|
||||
Q(recvfrom)
|
||||
Q(sendto)
|
||||
Q(setsockopt)
|
||||
Q(setblocking)
|
||||
|
||||
Q(AF_UNIX)
|
||||
Q(AF_INET)
|
||||
Q(AF_INET6)
|
||||
Q(SOCK_STREAM)
|
||||
Q(SOCK_DGRAM)
|
||||
Q(SOCK_RAW)
|
||||
|
||||
Q(MSG_DONTROUTE)
|
||||
Q(MSG_DONTWAIT)
|
||||
|
||||
Q(SOL_SOCKET)
|
||||
Q(SO_BROADCAST)
|
||||
Q(SO_ERROR)
|
||||
Q(SO_KEEPALIVE)
|
||||
Q(SO_LINGER)
|
||||
Q(SO_REUSEADDR)
|
||||
|
||||
#if MICROPY_PY_TERMIOS
|
||||
Q(termios)
|
||||
Q(tcgetattr)
|
||||
Q(tcsetattr)
|
||||
Q(setraw)
|
||||
Q(TCSANOW)
|
||||
Q(B9600)
|
||||
Q(B57600)
|
||||
Q(B115200)
|
||||
#endif
|
||||
|
||||
#if MICROPY_PY_JNI
|
||||
Q(jni)
|
||||
Q(cls)
|
||||
Q(env)
|
||||
Q(jclass)
|
||||
Q(jobject)
|
||||
Q(jmethod)
|
||||
#endif
|
||||
|
||||
@@ -56,4 +56,10 @@ endif
|
||||
|
||||
LIB += -lws2_32
|
||||
|
||||
# List of sources for qstr extraction
|
||||
SRC_QSTR += $(SRC_C)
|
||||
# Append any auto-generated sources that are needed by sources listed in
|
||||
# SRC_QSTR
|
||||
SRC_QSTR_AUTO_DEPS +=
|
||||
|
||||
include ../py/mkrules.mk
|
||||
|
||||
Reference in New Issue
Block a user