summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
Diffstat (limited to 'py')
-rw-r--r--py/circuitpy_defns.mk5
-rw-r--r--py/circuitpy_mpconfig.h10
-rw-r--r--py/circuitpy_mpconfig.mk3
-rw-r--r--py/makeqstrdata.py6
4 files changed, 14 insertions, 10 deletions
diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk
index 515b386f9..b70ae64a8 100644
--- a/py/circuitpy_defns.mk
+++ b/py/circuitpy_defns.mk
@@ -145,7 +145,7 @@ ifeq ($(CIRCUITPY_DIGITALIO),1)
SRC_PATTERNS += digitalio/%
endif
ifeq ($(CIRCUITPY_DISPLAYIO),1)
-SRC_PATTERNS += displayio/% terminalio/% fontio/%
+SRC_PATTERNS += displayio/%
endif
ifeq ($(CIRCUITPY_VECTORIO),1)
SRC_PATTERNS += vectorio/%
@@ -237,6 +237,9 @@ endif
ifeq ($(CIRCUITPY_SUPERVISOR),1)
SRC_PATTERNS += supervisor/%
endif
+ifeq ($(CIRCUITPY_TERMINALIO),1)
+SRC_PATTERNS += terminalio/% fontio/%
+endif
ifeq ($(CIRCUITPY_TIME),1)
SRC_PATTERNS += time/%
endif
diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h
index f0e8adffa..12d667d8f 100644
--- a/py/circuitpy_mpconfig.h
+++ b/py/circuitpy_mpconfig.h
@@ -347,16 +347,20 @@ extern const struct _mp_obj_module_t displayio_module;
extern const struct _mp_obj_module_t fontio_module;
extern const struct _mp_obj_module_t terminalio_module;
#define DISPLAYIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_displayio), (mp_obj_t)&displayio_module },
-#define FONTIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_fontio), (mp_obj_t)&fontio_module },
-#define TERMINALIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_terminalio), (mp_obj_t)&terminalio_module },
#ifndef CIRCUITPY_DISPLAY_LIMIT
#define CIRCUITPY_DISPLAY_LIMIT (1)
#endif
#else
#define DISPLAYIO_MODULE
+#define CIRCUITPY_DISPLAY_LIMIT (0)
+#endif
+
+#if CIRCUITPY_DISPLAYIO && CIRCUITPY_TERMINALIO
+#define FONTIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_fontio), (mp_obj_t)&fontio_module },
+#define TERMINALIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_terminalio), (mp_obj_t)&terminalio_module },
+#else
#define FONTIO_MODULE
#define TERMINALIO_MODULE
-#define CIRCUITPY_DISPLAY_LIMIT (0)
#endif
#if CIRCUITPY_FRAMEBUFFERIO
diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk
index 56060fa59..bdc1e77d5 100644
--- a/py/circuitpy_mpconfig.mk
+++ b/py/circuitpy_mpconfig.mk
@@ -195,6 +195,9 @@ CFLAGS += -DCIRCUITPY_STRUCT=$(CIRCUITPY_STRUCT)
CIRCUITPY_SUPERVISOR ?= 1
CFLAGS += -DCIRCUITPY_SUPERVISOR=$(CIRCUITPY_SUPERVISOR)
+CIRCUITPY_TERMINALIO ?= $(CIRCUITPY_DISPLAYIO)
+CFLAGS += -DCIRCUITPY_TERMINALIO=$(CIRCUITPY_TERMINALIO)
+
CIRCUITPY_TIME ?= 1
CFLAGS += -DCIRCUITPY_TIME=$(CIRCUITPY_TIME)
diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py
index df2c687e5..04c893876 100644
--- a/py/makeqstrdata.py
+++ b/py/makeqstrdata.py
@@ -102,10 +102,6 @@ def translate(translation_file, i18ns):
def compute_huffman_coding(translations, qstrs, compression_filename):
all_strings = [x[1] for x in translations]
-
- # go through each qstr and print it out
- for _, _, qstr in qstrs.values():
- all_strings.append(qstr)
all_strings_concat = "".join(all_strings)
counts = collections.Counter(all_strings_concat)
cb = huffman.codebook(counts.items())
@@ -259,8 +255,6 @@ def compress(encoding_table, decompressed, encoded_length_bits, len_translation_
current_bit -= 1
if current_bit != 7:
current_byte += 1
- if current_byte > len(decompressed):
- print("Note: compression increased length", repr(decompressed), len(decompressed), current_byte, file=sys.stderr)
return enc[:current_byte]
def qstr_escape(qst):