From da77eedafae1d4f9f554f04ca787759f09e9560a Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 17 May 2019 15:56:40 -0400 Subject: Enable MICROPY_PY_BUILTINS_ROUND_INT; make round() work beter when it's disabled as well --- py/circuitpy_mpconfig.h | 1 + py/modbuiltins.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'py') diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index f957886f4..0575bcfe0 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -89,6 +89,7 @@ #define MICROPY_PY_BUILTINS_MIN_MAX (1) #define MICROPY_PY_BUILTINS_PROPERTY (1) #define MICROPY_PY_BUILTINS_REVERSED (1) +#define MICROPY_PY_BUILTINS_ROUND_INT (1) #define MICROPY_PY_BUILTINS_SET (1) #define MICROPY_PY_BUILTINS_SLICE (1) #define MICROPY_PY_BUILTINS_SLICE_ATTRS (1) diff --git a/py/modbuiltins.c b/py/modbuiltins.c index 124dcd05a..e764f1987 100644 --- a/py/modbuiltins.c +++ b/py/modbuiltins.c @@ -455,13 +455,13 @@ STATIC mp_obj_t mp_builtin_round(size_t n_args, const mp_obj_t *args) { return o_in; } - #if !MICROPY_PY_BUILTINS_ROUND_INT - mp_raise_NotImplementedError(NULL); - #else mp_int_t num_dig = mp_obj_get_int(args[1]); if (num_dig >= 0) { return o_in; } + #if !MICROPY_PY_BUILTINS_ROUND_INT + mp_raise_NotImplementedError(NULL); + #else mp_obj_t mult = mp_binary_op(MP_BINARY_OP_POWER, MP_OBJ_NEW_SMALL_INT(10), MP_OBJ_NEW_SMALL_INT(-num_dig)); mp_obj_t half_mult = mp_binary_op(MP_BINARY_OP_FLOOR_DIVIDE, mult, MP_OBJ_NEW_SMALL_INT(2)); -- cgit v1.2.3 From 4e85c1ef91683929df0afe105e92ce6e4291b445 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 24 May 2019 15:32:24 -0400 Subject: Implement forced clean builds for boards so designated. Mark boards that set CFLAGS_INLINE_LIMIT for particular langauges as needing clean builds. Fixes #1910. --- .../circuitplayground_express/mpconfigboard.mk | 1 + .../mpconfigboard.mk | 1 + .../boards/feather_m0_express/mpconfigboard.mk | 1 + .../boards/itsybitsy_m0_express/mpconfigboard.mk | 1 + .../boards/metro_m0_express/mpconfigboard.mk | 1 + ports/atmel-samd/boards/pewpew10/mpconfigboard.mk | 1 + .../sparkfun_redboard_turbo/mpconfigboard.mk | 1 + py/circuitpy_defns.mk | 5 +++ tools/build_release_files.py | 37 ++++++++++++++++++---- 9 files changed, 43 insertions(+), 6 deletions(-) (limited to 'py') diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk index bc33be315..3b9eba7be 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk @@ -28,6 +28,7 @@ FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Thermistor # Tweak inlining depending on language. ifeq ($(TRANSLATION), zh_Latn_pinyin) CFLAGS_INLINE_LIMIT = 25 +RELEASE_NEEDS_CLEAN_BUILD = 1 else CFLAGS_INLINE_LIMIT = 55 endif diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk index 99ce90b3c..0a8ac37b8 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk @@ -21,6 +21,7 @@ CHIP_FAMILY = samd21 # Tweak inlining depending on language. ifeq ($(TRANSLATION), zh_Latn_pinyin) CFLAGS_INLINE_LIMIT = 23 +RELEASE_NEEDS_CLEAN_BUILD = 1 else CFLAGS_INLINE_LIMIT = 55 endif diff --git a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk index a6190267d..64d81c64c 100644 --- a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk @@ -15,4 +15,5 @@ CHIP_FAMILY = samd21 # Tweak inlining depending on language. ifeq ($(TRANSLATION), zh_Latn_pinyin) CFLAGS_INLINE_LIMIT = 60 +RELEASE_NEEDS_CLEAN_BUILD = 1 endif diff --git a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk index 4f3e1ca66..1b2a039b8 100644 --- a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk @@ -15,6 +15,7 @@ CHIP_FAMILY = samd21 # Tweak inlining depending on language. ifeq ($(TRANSLATION), zh_Latn_pinyin) CFLAGS_INLINE_LIMIT = 45 +RELEASE_NEEDS_CLEAN_BUILD = 1 else CFLAGS_INLINE_LIMIT = 70 endif diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk index ce9c4baba..ff5284aab 100644 --- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk @@ -16,4 +16,5 @@ CHIP_FAMILY = samd21 # Tweak inlining depending on language. ifeq ($(TRANSLATION), zh_Latn_pinyin) CFLAGS_INLINE_LIMIT = 50 +RELEASE_NEEDS_CLEAN_BUILD = 1 endif diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index b36a21368..ef0f8faa7 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -25,4 +25,5 @@ CIRCUITPY_SMALL_BUILD = 1 # Tweak inlining depending on language. ifeq ($(TRANSLATION), zh_Latn_pinyin) CFLAGS_INLINE_LIMIT = 40 +RELEASE_NEEDS_CLEAN_BUILD = 1 endif diff --git a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk index 9e45f8ad9..57400d6a7 100755 --- a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk @@ -16,4 +16,5 @@ EXTERNAL_FLASH_DEVICES = "W25Q32FV" # Tweak inlining depending on language. ifeq ($(TRANSLATION), zh_Latn_pinyin) CFLAGS_INLINE_LIMIT = 50 +RELEASE_NEEDS_CLEAN_BUILD = 1 endif diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 1aca33901..fd8e00354 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -361,3 +361,8 @@ $(addprefix lib/,\ libm/atan2f.c \ ) endif + +.PHONY: check-release-needs-clean-build + +check-release-needs-clean-build: + @echo "RELEASE_NEEDS_CLEAN_BUILD = $(RELEASE_NEEDS_CLEAN_BUILD)" diff --git a/tools/build_release_files.py b/tools/build_release_files.py index 872302a4f..e29b098c7 100755 --- a/tools/build_release_files.py +++ b/tools/build_release_files.py @@ -1,3 +1,5 @@ +#! /usr/bin/env python3 + import os import sys import subprocess @@ -6,7 +8,7 @@ import build_board_info as build_info import time for port in build_info.SUPPORTED_PORTS: - result = subprocess.run("rm -rf ../ports/{}/build*".format(port), shell=True) + result = subprocess.run("rm -rf ../ports/{port}/build*".format(port=port), shell=True) ROSIE_SETUPS = ["rosie-ci"] rosie_ok = {} @@ -37,7 +39,25 @@ for board in build_boards: bin_directory = "../bin/{board}/{language}".format(board=board, language=language) os.makedirs(bin_directory, exist_ok=True) start_time = time.monotonic() - make_result = subprocess.run("make -C ../ports/" + board_info["port"] + " TRANSLATION=" + language + " BOARD=" + board, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + + # Normally different language builds are all done based on the same set of compiled sources. + # But sometimes a particular language needs to be built from scratch, if, for instance, + # CFLAGS_INLINE_LIMIT is set for a particular language to make it fit. + clean_build_check_result = subprocess.run( + "make -C ../ports/{port} TRANSLATION={language} BOARD={board} check-release-needs-clean-build | fgrep 'RELEASE_NEEDS_CLEAN_BUILD = 1'".format( + port = board_info["port"], language=language, board=board), + shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + clean_build = clean_build_check_result.returncode == 0 + + build_dir = "build-{board}".format(board=board) + if clean_build: + build_dir += "-{language}".format(language=language) + + make_result = subprocess.run( + "make -C ../ports/{port} TRANSLATION={language} BOARD={board} BUILD={build}".format( + port = board_info["port"], language=language, board=board, build=build_dir), + shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + build_duration = time.monotonic() - start_time success = "\033[32msucceeded\033[0m" if make_result.returncode != 0: @@ -47,11 +67,14 @@ for board in build_boards: other_output = "" for extension in board_info["extensions"]: - temp_filename = "../ports/{port}/build-{board}/firmware.{extension}".format(port=board_info["port"], board=board, extension=extension) + temp_filename = "../ports/{port}/{build}/firmware.{extension}".format( + port=board_info["port"], build=build_dir, extension=extension) for alias in board_info["aliases"] + [board]: - bin_directory = "../bin/{alias}/{language}".format(alias=alias, language=language) + bin_directory = "../bin/{alias}/{language}".format( + alias=alias, language=language) os.makedirs(bin_directory, exist_ok=True) - final_filename = "adafruit-circuitpython-{alias}-{language}-{version}.{extension}".format(alias=alias, language=language, version=version, extension=extension) + final_filename = "adafruit-circuitpython-{alias}-{language}-{version}.{extension}".format( + alias=alias, language=language, version=version, extension=extension) final_filename = os.path.join(bin_directory, final_filename) try: shutil.copyfile(temp_filename, final_filename) @@ -62,7 +85,9 @@ for board in build_boards: if travis: print('travis_fold:start:adafruit-bins-{}-{}\\r'.format(language, board)) - print("Build {} for {} took {:.2f}s and {}".format(board, language, build_duration, success)) + print("Build {board} for {language}{clean_build} took {build_duration:.2f}s and {success}".format( + board=board, language=language, clean_build=(" (clean_build)" if clean_build else ""), + build_duration=build_duration, success=success)) if make_result.returncode != 0: print(make_result.stdout.decode("utf-8")) print(other_output) -- cgit v1.2.3 From 1da8d4b4da7b71a68d367601e10b4633606fab56 Mon Sep 17 00:00:00 2001 From: Elvis Pfützenreuter Date: Wed, 15 May 2019 23:29:34 -0300 Subject: Add PS/2 support -- ps2io module --- locale/ID.po | 17 +- locale/circuitpython.pot | 17 +- locale/de_DE.po | 17 +- locale/en_US.po | 17 +- locale/en_x_pirate.po | 17 +- locale/es.po | 17 +- locale/fil.po | 17 +- locale/fr.po | 17 +- locale/it_IT.po | 17 +- locale/pl.po | 17 +- locale/pt_BR.po | 17 +- locale/zh_Latn_pinyin.po | 17 +- ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk | 2 + .../boards/datalore_ip_m4/mpconfigboard.mk | 2 + .../boards/feather_m4_express/mpconfigboard.mk | 2 + .../grandcentral_m4_express/mpconfigboard.mk | 2 + .../boards/itsybitsy_m4_express/mpconfigboard.mk | 2 + .../boards/metro_m4_airlift_lite/mpconfigboard.mk | 2 + .../boards/metro_m4_express/mpconfigboard.mk | 2 + .../atmel-samd/boards/mini_sam_m4/mpconfigboard.mk | 2 + .../boards/trellis_m4_express/mpconfigboard.mk | 2 + ports/atmel-samd/common-hal/ps2io/Ps2.c | 441 +++++++++++++++++++++ ports/atmel-samd/common-hal/ps2io/Ps2.h | 62 +++ ports/atmel-samd/common-hal/ps2io/__init__.c | 1 + ports/atmel-samd/eic_handler.c | 7 + ports/atmel-samd/eic_handler.h | 1 + ports/atmel-samd/supervisor/port.c | 1 + ports/atmel-samd/tools/gen_pin_name_table.py | 3 + py/circuitpy_defns.mk | 5 + py/circuitpy_mpconfig.h | 8 + py/circuitpy_mpconfig.mk | 6 + shared-bindings/index.rst | 1 + shared-bindings/ps2io/Ps2.c | 237 +++++++++++ shared-bindings/ps2io/Ps2.h | 45 +++ shared-bindings/ps2io/__init__.c | 73 ++++ shared-bindings/ps2io/__init__.h | 35 ++ 36 files changed, 1124 insertions(+), 24 deletions(-) create mode 100644 ports/atmel-samd/common-hal/ps2io/Ps2.c create mode 100644 ports/atmel-samd/common-hal/ps2io/Ps2.h create mode 100644 ports/atmel-samd/common-hal/ps2io/__init__.c create mode 100644 shared-bindings/ps2io/Ps2.c create mode 100644 shared-bindings/ps2io/Ps2.h create mode 100644 shared-bindings/ps2io/__init__.c create mode 100644 shared-bindings/ps2io/__init__.h (limited to 'py') diff --git a/locale/ID.po b/locale/ID.po index f5c0c0949..e9d26e2a6 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-05-13 17:34-0700\n" +"POT-Creation-Date: 2019-05-22 15:56-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -518,6 +518,7 @@ msgid "Drive mode not used when direction is input." msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "EXTINT channel already in use" msgstr "Channel EXTINT sedang digunakan" @@ -546,6 +547,10 @@ msgstr "" msgid "Expected tuple of length %d, got %d" msgstr "" +#: shared-bindings/ps2io/Ps2.c +msgid "Failed sending command." +msgstr "" + #: ports/nrf/common-hal/bleio/Device.c #, fuzzy msgid "Failed to acquire mutex" @@ -932,6 +937,10 @@ msgstr "Tidak ada GCLK yang kosong" msgid "No hardware random available" msgstr "" +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +msgid "No hardware support on clk pin" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "No hardware support on pin" @@ -1015,6 +1024,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "Tambahkan module apapun pada filesystem\n" +#: shared-bindings/ps2io/Ps2.c +msgid "Pop from an empty Ps2 buffer" +msgstr "" + #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" @@ -2176,7 +2189,7 @@ msgstr "" msgid "object not callable" msgstr "" -#: py/sequence.c +#: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 34070dc69..ed58d75f0 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-05-13 17:41-0700\n" +"POT-Creation-Date: 2019-05-22 16:00-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -506,6 +506,7 @@ msgid "Drive mode not used when direction is input." msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "EXTINT channel already in use" msgstr "" @@ -534,6 +535,10 @@ msgstr "" msgid "Expected tuple of length %d, got %d" msgstr "" +#: shared-bindings/ps2io/Ps2.c +msgid "Failed sending command." +msgstr "" + #: ports/nrf/common-hal/bleio/Device.c msgid "Failed to acquire mutex" msgstr "" @@ -907,6 +912,10 @@ msgstr "" msgid "No hardware random available" msgstr "" +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +msgid "No hardware support on clk pin" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "No hardware support on pin" @@ -989,6 +998,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "" +#: shared-bindings/ps2io/Ps2.c +msgid "Pop from an empty Ps2 buffer" +msgstr "" + #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" @@ -2131,7 +2144,7 @@ msgstr "" msgid "object not callable" msgstr "" -#: py/sequence.c +#: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 2cb97c3d3..936aaffa2 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-05-13 17:34-0700\n" +"POT-Creation-Date: 2019-05-22 15:56-0300\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -510,6 +510,7 @@ msgid "Drive mode not used when direction is input." msgstr "Drive mode wird nicht verwendet, wenn die Richtung input ist." #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "EXTINT channel already in use" msgstr "EXTINT Kanal ist schon in Benutzung" @@ -538,6 +539,10 @@ msgstr "Eine UUID wird erwartet" msgid "Expected tuple of length %d, got %d" msgstr "Habe ein Tupel der Länge %d erwartet aber %d erhalten" +#: shared-bindings/ps2io/Ps2.c +msgid "Failed sending command." +msgstr "" + #: ports/nrf/common-hal/bleio/Device.c msgid "Failed to acquire mutex" msgstr "Akquirieren des Mutex gescheitert" @@ -920,6 +925,10 @@ msgstr "Keine freien GCLKs" msgid "No hardware random available" msgstr "Kein hardware random verfügbar" +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +msgid "No hardware support on clk pin" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "No hardware support on pin" @@ -1004,6 +1013,10 @@ msgstr "Pixel außerhalb der Puffergrenzen" msgid "Plus any modules on the filesystem\n" msgstr "und alle Module im Dateisystem \n" +#: shared-bindings/ps2io/Ps2.c +msgid "Pop from an empty Ps2 buffer" +msgstr "" + #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" @@ -2178,7 +2191,7 @@ msgstr "Objekt ist kein Iterator" msgid "object not callable" msgstr "" -#: py/sequence.c +#: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" msgstr "Objekt ist nicht in sequence" diff --git a/locale/en_US.po b/locale/en_US.po index ebc18cfae..cea074190 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-05-13 17:34-0700\n" +"POT-Creation-Date: 2019-05-22 15:56-0300\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -506,6 +506,7 @@ msgid "Drive mode not used when direction is input." msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "EXTINT channel already in use" msgstr "" @@ -534,6 +535,10 @@ msgstr "" msgid "Expected tuple of length %d, got %d" msgstr "" +#: shared-bindings/ps2io/Ps2.c +msgid "Failed sending command." +msgstr "" + #: ports/nrf/common-hal/bleio/Device.c msgid "Failed to acquire mutex" msgstr "" @@ -907,6 +912,10 @@ msgstr "" msgid "No hardware random available" msgstr "" +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +msgid "No hardware support on clk pin" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "No hardware support on pin" @@ -989,6 +998,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "" +#: shared-bindings/ps2io/Ps2.c +msgid "Pop from an empty Ps2 buffer" +msgstr "" + #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" @@ -2131,7 +2144,7 @@ msgstr "" msgid "object not callable" msgstr "" -#: py/sequence.c +#: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 04706abdc..6889c29b7 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-05-13 17:34-0700\n" +"POT-Creation-Date: 2019-05-22 15:56-0300\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -510,6 +510,7 @@ msgid "Drive mode not used when direction is input." msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "EXTINT channel already in use" msgstr "Avast! EXTINT channel already in use" @@ -538,6 +539,10 @@ msgstr "" msgid "Expected tuple of length %d, got %d" msgstr "" +#: shared-bindings/ps2io/Ps2.c +msgid "Failed sending command." +msgstr "" + #: ports/nrf/common-hal/bleio/Device.c msgid "Failed to acquire mutex" msgstr "" @@ -911,6 +916,10 @@ msgstr "" msgid "No hardware random available" msgstr "" +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +msgid "No hardware support on clk pin" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "No hardware support on pin" @@ -993,6 +1002,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "" +#: shared-bindings/ps2io/Ps2.c +msgid "Pop from an empty Ps2 buffer" +msgstr "" + #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" @@ -2135,7 +2148,7 @@ msgstr "" msgid "object not callable" msgstr "" -#: py/sequence.c +#: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" msgstr "" diff --git a/locale/es.po b/locale/es.po index 77739f49c..f7f1ea0c4 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-05-13 17:34-0700\n" +"POT-Creation-Date: 2019-05-22 15:56-0300\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -524,6 +524,7 @@ msgid "Drive mode not used when direction is input." msgstr "Modo Drive no se usa cuando la dirección es input." #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "EXTINT channel already in use" msgstr "El canal EXTINT ya está siendo utilizado" @@ -554,6 +555,10 @@ msgstr "Se espera un %q" msgid "Expected tuple of length %d, got %d" msgstr "Se esperaba un tuple de %d, se obtuvo %d" +#: shared-bindings/ps2io/Ps2.c +msgid "Failed sending command." +msgstr "" + #: ports/nrf/common-hal/bleio/Device.c #, fuzzy msgid "Failed to acquire mutex" @@ -946,6 +951,10 @@ msgstr "Sin GCLKs libres" msgid "No hardware random available" msgstr "No hay hardware random disponible" +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +msgid "No hardware support on clk pin" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "No hardware support on pin" @@ -1035,6 +1044,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "Incapaz de montar de nuevo el sistema de archivos" +#: shared-bindings/ps2io/Ps2.c +msgid "Pop from an empty Ps2 buffer" +msgstr "" + #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" @@ -2213,7 +2226,7 @@ msgstr "objeto no es un iterator" msgid "object not callable" msgstr "objeto no puede ser llamado" -#: py/sequence.c +#: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" msgstr "objeto no en secuencia" diff --git a/locale/fil.po b/locale/fil.po index 5954e29b4..73e6e79e7 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-05-13 17:34-0700\n" +"POT-Creation-Date: 2019-05-22 15:56-0300\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -519,6 +519,7 @@ msgid "Drive mode not used when direction is input." msgstr "Drive mode ay hindi ginagamit kapag ang direksyon ay input." #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "EXTINT channel already in use" msgstr "Ginagamit na ang EXTINT channel" @@ -549,6 +550,10 @@ msgstr "Umasa ng %q" msgid "Expected tuple of length %d, got %d" msgstr "" +#: shared-bindings/ps2io/Ps2.c +msgid "Failed sending command." +msgstr "" + #: ports/nrf/common-hal/bleio/Device.c #, fuzzy msgid "Failed to acquire mutex" @@ -941,6 +946,10 @@ msgstr "Walang libreng GCLKs" msgid "No hardware random available" msgstr "Walang magagamit na hardware random" +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +msgid "No hardware support on clk pin" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "No hardware support on pin" @@ -1028,6 +1037,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "Kasama ang kung ano pang modules na sa filesystem\n" +#: shared-bindings/ps2io/Ps2.c +msgid "Pop from an empty Ps2 buffer" +msgstr "" + #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" @@ -2212,7 +2225,7 @@ msgstr "object ay hindi iterator" msgid "object not callable" msgstr "hindi matatawag ang object" -#: py/sequence.c +#: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" msgstr "object wala sa sequence" diff --git a/locale/fr.po b/locale/fr.po index 0bd0f8771..0362e1c49 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-05-13 17:34-0700\n" +"POT-Creation-Date: 2019-05-22 15:56-0300\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -522,6 +522,7 @@ msgid "Drive mode not used when direction is input." msgstr "Le mode Drive n'est pas utilisé quand la direction est 'input'." #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "EXTINT channel already in use" msgstr "Canal EXTINT déjà utilisé" @@ -552,6 +553,10 @@ msgstr "Un UUID est attendu" msgid "Expected tuple of length %d, got %d" msgstr "Tuple de longueur %d attendu, obtenu %d" +#: shared-bindings/ps2io/Ps2.c +msgid "Failed sending command." +msgstr "" + #: ports/nrf/common-hal/bleio/Device.c #, fuzzy msgid "Failed to acquire mutex" @@ -949,6 +954,10 @@ msgstr "Pas de GCLK libre" msgid "No hardware random available" msgstr "Pas de source matérielle d'aléa disponible" +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +msgid "No hardware support on clk pin" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "No hardware support on pin" @@ -1045,6 +1054,10 @@ msgstr "Pixel au-delà des limites du tampon" msgid "Plus any modules on the filesystem\n" msgstr "Ainsi que tout autre module présent sur le système de fichiers\n" +#: shared-bindings/ps2io/Ps2.c +msgid "Pop from an empty Ps2 buffer" +msgstr "" + #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "Appuyez sur une touche pour entrer sur REPL ou CTRL-D pour recharger." @@ -2247,7 +2260,7 @@ msgstr "l'objet n'est pas un itérateur" msgid "object not callable" msgstr "objet non appelable" -#: py/sequence.c +#: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" msgstr "l'objet n'est pas dans la séquence" diff --git a/locale/it_IT.po b/locale/it_IT.po index 12f21c38e..760f00423 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-05-13 17:34-0700\n" +"POT-Creation-Date: 2019-05-22 15:56-0300\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -519,6 +519,7 @@ msgid "Drive mode not used when direction is input." msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "EXTINT channel already in use" msgstr "Canale EXTINT già in uso" @@ -549,6 +550,10 @@ msgstr "Atteso un %q" msgid "Expected tuple of length %d, got %d" msgstr "" +#: shared-bindings/ps2io/Ps2.c +msgid "Failed sending command." +msgstr "" + #: ports/nrf/common-hal/bleio/Device.c #, fuzzy msgid "Failed to acquire mutex" @@ -940,6 +945,10 @@ msgstr "Nessun GCLK libero" msgid "No hardware random available" msgstr "Nessun generatore hardware di numeri casuali disponibile" +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +msgid "No hardware support on clk pin" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "No hardware support on pin" @@ -1033,6 +1042,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "Imposssibile rimontare il filesystem" +#: shared-bindings/ps2io/Ps2.c +msgid "Pop from an empty Ps2 buffer" +msgstr "" + #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" @@ -2208,7 +2221,7 @@ msgstr "l'oggetto non è un iteratore" msgid "object not callable" msgstr "" -#: py/sequence.c +#: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" msgstr "oggetto non in sequenza" diff --git a/locale/pl.po b/locale/pl.po index 1a7471f72..10752c703 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-05-13 17:34-0700\n" +"POT-Creation-Date: 2019-05-22 15:56-0300\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -509,6 +509,7 @@ msgid "Drive mode not used when direction is input." msgstr "Tryb sterowania nieużywany w trybie wejścia." #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "EXTINT channel already in use" msgstr "Kanał EXTINT w użyciu" @@ -537,6 +538,10 @@ msgstr "Oczekiwano UUID" msgid "Expected tuple of length %d, got %d" msgstr "Oczekiwano krotkę długości %d, otrzymano %d" +#: shared-bindings/ps2io/Ps2.c +msgid "Failed sending command." +msgstr "" + #: ports/nrf/common-hal/bleio/Device.c msgid "Failed to acquire mutex" msgstr "Nie udało się uzyskać blokady" @@ -917,6 +922,10 @@ msgstr "Brak wolnych GLCK" msgid "No hardware random available" msgstr "Brak generatora liczb losowych" +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +msgid "No hardware support on clk pin" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "No hardware support on pin" @@ -999,6 +1008,10 @@ msgstr "Piksel poza granicami bufora" msgid "Plus any modules on the filesystem\n" msgstr "Oraz moduły w systemie plików\n" +#: shared-bindings/ps2io/Ps2.c +msgid "Pop from an empty Ps2 buffer" +msgstr "" + #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "Dowolny klawisz aby uruchomić konsolę. CTRL-D aby przeładować." @@ -2156,7 +2169,7 @@ msgstr "obiekt nie jest iteratorem" msgid "object not callable" msgstr "obiekt nie jest wywoływalny" -#: py/sequence.c +#: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" msgstr "obiektu nie ma sekwencji" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 390610041..e2b13cbd3 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-05-13 17:34-0700\n" +"POT-Creation-Date: 2019-05-22 15:56-0300\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -514,6 +514,7 @@ msgid "Drive mode not used when direction is input." msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "EXTINT channel already in use" msgstr "Canal EXTINT em uso" @@ -544,6 +545,10 @@ msgstr "Esperado um" msgid "Expected tuple of length %d, got %d" msgstr "" +#: shared-bindings/ps2io/Ps2.c +msgid "Failed sending command." +msgstr "Falha ao enviar comando." + #: ports/nrf/common-hal/bleio/Device.c #, fuzzy msgid "Failed to acquire mutex" @@ -930,6 +935,10 @@ msgstr "Não há GCLKs livre" msgid "No hardware random available" msgstr "" +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +msgid "No hardware support on clk pin" +msgstr "Sem suporte de hardware no pino de clock" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "No hardware support on pin" @@ -1016,6 +1025,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "Não é possível remontar o sistema de arquivos" +#: shared-bindings/ps2io/Ps2.c +msgid "Pop from an empty Ps2 buffer" +msgstr "Buffer Ps2 vazio" + #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" @@ -2165,7 +2178,7 @@ msgstr "" msgid "object not callable" msgstr "" -#: py/sequence.c +#: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" msgstr "objeto não em seqüência" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 82264cb52..dbc87115b 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-05-13 17:34-0700\n" +"POT-Creation-Date: 2019-05-22 15:56-0300\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -510,6 +510,7 @@ msgid "Drive mode not used when direction is input." msgstr "Fāngxiàng shūrù shí qūdòng móshì méiyǒu shǐyòng." #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "EXTINT channel already in use" msgstr "EXTINT píndào yǐjīng shǐyòng" @@ -538,6 +539,10 @@ msgstr "Yùqí UUID" msgid "Expected tuple of length %d, got %d" msgstr "Qīwàng de chángdù wèi %d de yuán zǔ, dédào %d" +#: shared-bindings/ps2io/Ps2.c +msgid "Failed sending command." +msgstr "" + #: ports/nrf/common-hal/bleio/Device.c msgid "Failed to acquire mutex" msgstr "Wúfǎ huòdé mutex" @@ -917,6 +922,10 @@ msgstr "Méiyǒu miǎnfèi de GCLKs" msgid "No hardware random available" msgstr "Méiyǒu kěyòng de yìngjiàn suíjī" +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +msgid "No hardware support on clk pin" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "No hardware support on pin" @@ -1004,6 +1013,10 @@ msgstr "Xiàngsù chāochū huǎnchōng qū biānjiè" msgid "Plus any modules on the filesystem\n" msgstr "Zài wénjiàn xìtǒng shàng tiānjiā rènhé mókuài\n" +#: shared-bindings/ps2io/Ps2.c +msgid "Pop from an empty Ps2 buffer" +msgstr "" + #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "Àn xià rènhé jiàn jìnrù REPL. Shǐyòng CTRL-D chóngxīn jiāzài." @@ -2168,7 +2181,7 @@ msgstr "duìxiàng bùshì diédài qì" msgid "object not callable" msgstr "duìxiàng wúfǎ diàoyòng" -#: py/sequence.c +#: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" msgstr "duìxiàng bùshì xùliè" diff --git a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk index 0444a37b9..c566795c4 100644 --- a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk @@ -15,3 +15,5 @@ CIRCUITPY_TOUCHIO = 0 CHIP_VARIANT = SAMD51J20A CHIP_FAMILY = samd51 + +CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk index e6b21e25b..af1037c38 100644 --- a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk @@ -18,3 +18,5 @@ CIRCUITPY_TOUCHIO = 0 CIRCUITPY_NETWORK = 1 MICROPY_PY_WIZNET5K = 5500 + +CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk index 4fddcffc1..5972b5e46 100644 --- a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk @@ -18,3 +18,5 @@ CHIP_FAMILY = samd51 CIRCUITPY_NETWORK = 1 MICROPY_PY_WIZNET5K = 5500 + +CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk index 63158681b..0ae23bdef 100644 --- a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk @@ -15,3 +15,5 @@ CIRCUITPY_TOUCHIO = 0 CHIP_VARIANT = SAMD51P20A CHIP_FAMILY = samd51 + +CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk index d4d674d9d..176935c38 100644 --- a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk @@ -16,3 +16,5 @@ CIRCUITPY_TOUCHIO = 0 CHIP_VARIANT = SAMD51G19A CHIP_FAMILY = samd51 + +CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk index 654a84eb8..2a6191b36 100644 --- a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk @@ -18,3 +18,5 @@ CHIP_FAMILY = samd51 CIRCUITPY_NETWORK = 1 MICROPY_PY_WIZNET5K = 5500 + +CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk index 35162b678..32e623e67 100644 --- a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk @@ -18,3 +18,5 @@ CHIP_FAMILY = samd51 CIRCUITPY_NETWORK = 1 MICROPY_PY_WIZNET5K = 5500 + +CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk index 27bad2693..5f744dfd2 100644 --- a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk @@ -17,3 +17,5 @@ CIRCUITPY_TOUCHIO = 0 CHIP_VARIANT = SAMD51G19A CHIP_FAMILY = samd51 + +CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk index 93b07bc76..bfcada0d7 100644 --- a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk @@ -16,3 +16,5 @@ CIRCUITPY_TOUCHIO = 0 CHIP_VARIANT = SAMD51G19A CHIP_FAMILY = samd51 + +CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/common-hal/ps2io/Ps2.c b/ports/atmel-samd/common-hal/ps2io/Ps2.c new file mode 100644 index 000000000..6a06864f2 --- /dev/null +++ b/ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -0,0 +1,441 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017-2018 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Elvis Pfutzenreuter + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "common-hal/ps2io/Ps2.h" + +#include + +#include "atmel_start_pins.h" +#include "hal/include/hal_gpio.h" + +#include "background.h" +#include "eic_handler.h" +#include "mpconfigport.h" +#include "py/gc.h" +#include "py/runtime.h" +#include "samd/external_interrupts.h" +#include "samd/pins.h" +#include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/ps2io/Ps2.h" +#include "supervisor/shared/translate.h" + +#include "tick.h" + +#define STATE_IDLE 0 +#define STATE_RECV 1 +#define STATE_RECV_PARITY 2 +#define STATE_RECV_STOP 3 +#define STATE_RECV_ERR 10 + +#define ERROR_STARTBIT 0x01 +#define ERROR_TIMEOUT 0x02 +#define ERROR_PARITY 0x04 +#define ERROR_STOPBIT 0x08 +#define ERROR_BUFFER 0x10 + +#define ERROR_TX_CLKLO 0x100 +#define ERROR_TX_CLKHI 0x200 +#define ERROR_TX_ACKDATA 0x400 +#define ERROR_TX_ACKCLK 0x800 +#define ERROR_TX_RTS 0x1000 +#define ERROR_TX_NORESP 0x2000 + +static void ps2_set_config(ps2io_ps2_obj_t* self) { + uint32_t sense_setting = EIC_CONFIG_SENSE0_FALL_Val; + set_eic_handler(self->channel, EIC_HANDLER_PS2); + turn_on_eic_channel(self->channel, sense_setting); +} + +static void disable_interrupt(ps2io_ps2_obj_t* self) { + uint32_t mask = 1 << self->channel; + EIC->INTENCLR.reg = mask << EIC_INTENSET_EXTINT_Pos; +} + +static void resume_interrupt(ps2io_ps2_obj_t* self) { + disable_interrupt(self); + + self->state = STATE_IDLE; + gpio_set_pin_function(self->clk_pin, GPIO_PIN_FUNCTION_A); + uint32_t mask = 1 << self->channel; + EIC->INTFLAG.reg = mask << EIC_INTFLAG_EXTINT_Pos; + EIC->INTENSET.reg = mask << EIC_INTENSET_EXTINT_Pos; + + ps2_set_config(self); +} + +static void clk_hi(ps2io_ps2_obj_t* self) { + // External pull-up + // Must set pull after setting direction. + gpio_set_pin_direction(self->clk_pin, GPIO_DIRECTION_IN); + gpio_set_pin_pull_mode(self->clk_pin, GPIO_PULL_OFF); +} + +static bool wait_clk_lo(ps2io_ps2_obj_t* self, uint32_t us) { + clk_hi(self); + common_hal_mcu_delay_us(1); + while (gpio_get_pin_level(self->clk_pin) && us) { + --us; + common_hal_mcu_delay_us(1); + } + return us; +} + +static bool wait_clk_hi(ps2io_ps2_obj_t* self, uint32_t us) { + clk_hi(self); + common_hal_mcu_delay_us(1); + while (!gpio_get_pin_level(self->clk_pin) && us) { + --us; + common_hal_mcu_delay_us(1); + } + return us; +} + +static void clk_lo(ps2io_ps2_obj_t* self) { + gpio_set_pin_pull_mode(self->clk_pin, GPIO_PULL_OFF); + gpio_set_pin_direction(self->clk_pin, GPIO_DIRECTION_OUT); + gpio_set_pin_level(self->clk_pin, 0); +} + +static void data_hi(ps2io_ps2_obj_t* self) { + // External pull-up + gpio_set_pin_direction(self->data_pin, GPIO_DIRECTION_IN); + gpio_set_pin_pull_mode(self->data_pin, GPIO_PULL_OFF); +} + +static bool wait_data_lo(ps2io_ps2_obj_t* self, uint32_t us) { + data_hi(self); + common_hal_mcu_delay_us(1); + while (gpio_get_pin_level(self->data_pin) && us) { + --us; + common_hal_mcu_delay_us(1); + } + return us; +} + +static bool wait_data_hi(ps2io_ps2_obj_t* self, uint32_t us) { + data_hi(self); + common_hal_mcu_delay_us(1); + while (!gpio_get_pin_level(self->data_pin) && us) { + --us; + common_hal_mcu_delay_us(1); + } + return us; +} + +static void data_lo(ps2io_ps2_obj_t* self) { + gpio_set_pin_pull_mode(self->data_pin, GPIO_PULL_OFF); + gpio_set_pin_direction(self->data_pin, GPIO_DIRECTION_OUT); + gpio_set_pin_level(self->data_pin, 0); +} + +static void idle(ps2io_ps2_obj_t* self) { + clk_hi(self); + data_hi(self); +} + +static void inhibit(ps2io_ps2_obj_t* self) { + clk_lo(self); + data_hi(self); +} + +static void delay_us(uint32_t t) { + common_hal_mcu_delay_us(t); +} + +void ps2_interrupt_handler(uint8_t channel) { + // Grab the current time first. + uint32_t current_us; + uint64_t current_ms; + current_tick(¤t_ms, ¤t_us); + + ps2io_ps2_obj_t* self = get_eic_channel_data(channel); + int data_bit = gpio_get_pin_level(self->data_pin) ? 1 : 0; + + // test for timeout + if (self->state != STATE_IDLE) { + int64_t diff_ms = current_ms - self->last_int_ms; + if (diff_ms >= 2) { // a.k.a. > 1.001ms + self->last_errors |= ERROR_TIMEOUT; + self->state = STATE_IDLE; + } + } + + self->last_int_us = current_us; + self->last_int_ms = current_ms; + + if (self->state == STATE_IDLE) { + self->bits = 0; + self->parity = false; + self->bitcount = 0; + self->state = STATE_RECV; + if (data_bit) { + // start bit should be 0 + self->last_errors |= ERROR_STARTBIT; + self->state = STATE_RECV_ERR; + } else { + self->state = STATE_RECV; + } + + } else if (self->state == STATE_RECV) { + if (data_bit) { + self->bits |= data_bit << self->bitcount; + self->parity = !self->parity; + } + ++self->bitcount; + if (self->bitcount >= 8) { + self->state = STATE_RECV_PARITY; + } + + } else if (self->state == STATE_RECV_PARITY) { + ++self->bitcount; + if (data_bit) { + self->parity = !self->parity; + } + if (!self->parity) { + self->last_errors |= ERROR_PARITY; + self->state = STATE_RECV_ERR; + } else { + self->state = STATE_RECV_STOP; + } + + } else if (self->state == STATE_RECV_STOP) { + ++self->bitcount; + if (! data_bit) { + self->last_errors |= ERROR_STOPBIT; + } else if (self->waiting_cmd_response) { + self->cmd_response = self->bits; + self->waiting_cmd_response = false; + } else if (self->bufcount >= sizeof(self->buffer)) { + self->last_errors |= ERROR_BUFFER; + } else { + self->buffer[self->bufposw] = self->bits; + self->bufposw = (self->bufposw + 1) % sizeof(self->buffer); + self->bufcount++; + } + self->state = STATE_IDLE; + + } else if (self->state == STATE_RECV_ERR) { + // just count the bits until idle + if (++self->bitcount >= 10) { + self->state = STATE_IDLE; + } + } +} + +void common_hal_ps2io_ps2_construct(ps2io_ps2_obj_t* self, + const mcu_pin_obj_t* data_pin, const mcu_pin_obj_t* clk_pin) { + if (!clk_pin->has_extint) { + mp_raise_RuntimeError(translate("No hardware support on clk pin")); + } + if (eic_get_enable() && !eic_channel_free(clk_pin->extint_channel)) { + mp_raise_RuntimeError(translate("EXTINT channel already in use")); + } + + clk_hi(self); + data_hi(self); + + self->channel = clk_pin->extint_channel; + self->clk_pin = clk_pin->number; + self->data_pin = data_pin->number; + self->state = STATE_IDLE; + self->bufcount = 0; + self->bufposr = 0; + self->bufposw = 0; + self->waiting_cmd_response = false; + + set_eic_channel_data(clk_pin->extint_channel, (void*) self); + + // Check to see if the EIC is enabled and start it up if its not.' + if (eic_get_enable() == 0) { + turn_on_external_interrupt_controller(); + } + + gpio_set_pin_function(clk_pin->number, GPIO_PIN_FUNCTION_A); + gpio_set_pin_function(data_pin->number, GPIO_PIN_FUNCTION_A); + + turn_on_cpu_interrupt(self->channel); + + claim_pin(clk_pin); + claim_pin(data_pin); + + // Set config will enable the EIC. + ps2_set_config(self); +} + +bool common_hal_ps2io_ps2_deinited(ps2io_ps2_obj_t* self) { + return self->clk_pin == NO_PIN; +} + +void common_hal_ps2io_ps2_deinit(ps2io_ps2_obj_t* self) { + if (common_hal_ps2io_ps2_deinited(self)) { + return; + } + set_eic_handler(self->channel, EIC_HANDLER_NO_INTERRUPT); + turn_off_eic_channel(self->channel); + reset_pin_number(self->clk_pin); + reset_pin_number(self->data_pin); + self->clk_pin = NO_PIN; + self->data_pin = NO_PIN; +} + +uint16_t common_hal_ps2io_ps2_get_len(ps2io_ps2_obj_t* self) { + return self->bufcount; +} + +bool common_hal_ps2io_ps2_get_paused(ps2io_ps2_obj_t* self) { + uint32_t mask = 1 << self->channel; + return (EIC->INTENSET.reg & (mask << EIC_INTENSET_EXTINT_Pos)) == 0; +} + +int16_t common_hal_ps2io_ps2_popleft(ps2io_ps2_obj_t* self) +{ + common_hal_mcu_disable_interrupts(); + if (self->bufcount <= 0) { + common_hal_mcu_enable_interrupts(); + return -1; + } + uint8_t b = self->buffer[self->bufposr]; + self->bufposr = (self->bufposr + 1) % sizeof(self->buffer); + self->bufcount -= 1; + common_hal_mcu_enable_interrupts(); + return b; +} + +uint16_t common_hal_ps2io_ps2_clear_errors(ps2io_ps2_obj_t* self) +{ + common_hal_mcu_disable_interrupts(); + uint16_t errors = self->last_errors; + self->last_errors = 0; + common_hal_mcu_enable_interrupts(); + return errors; +} + +// Based upon TMK implementation of PS/2 protocol +// https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/protocol/ps2_interrupt.c + +int16_t common_hal_ps2io_ps2_sendcmd(ps2io_ps2_obj_t* self, uint8_t b) +{ + disable_interrupt(self); + inhibit(self); + delay_us(100); + + /* RTS and start bit */ + data_lo(self); + clk_hi(self); + if (!wait_clk_lo(self, 10000)) { + self->last_errors |= ERROR_TX_RTS; + goto ERROR; + } + + bool parity = true; + for (uint8_t i = 0; i < 8; i++) { + delay_us(15); + if (b & (1 << i)) { + parity = !parity; + data_hi(self); + } else { + data_lo(self); + } + if (!wait_clk_hi(self, 50)) { + self->last_errors |= ERROR_TX_CLKHI; + goto ERROR; + } + if (!wait_clk_lo(self, 50)) { + self->last_errors |= ERROR_TX_CLKLO; + goto ERROR; + } + } + + delay_us(15); + if (parity) { + data_hi(self); + } else { + data_lo(self); + } + if (!wait_clk_hi(self, 50)) { + self->last_errors |= ERROR_TX_CLKHI; + goto ERROR; + } + if (!wait_clk_lo(self, 50)) { + self->last_errors |= ERROR_TX_CLKLO; + goto ERROR; + } + + /* Stop bit */ + delay_us(15); + data_hi(self); + + /* Ack */ + if (!wait_data_lo(self, 50)) { + self->last_errors |= ERROR_TX_ACKDATA; + goto ERROR; + } + if (!wait_clk_lo(self, 50)) { + self->last_errors |= ERROR_TX_ACKCLK; + goto ERROR; + } + + /* wait for idle state */ + if (!wait_clk_hi(self, 50)) { + self->last_errors |= ERROR_TX_ACKCLK; + goto ERROR; + } + if (!wait_data_hi(self, 50)) { + self->last_errors |= ERROR_TX_ACKDATA; + goto ERROR; + } + + /* Wait for response byte */ + self->waiting_cmd_response = true; + idle(self); + resume_interrupt(self); + + for (int i = 0; i < 25; ++i) { + delay_us(1000); + common_hal_mcu_disable_interrupts(); + bool has_response = !self->waiting_cmd_response; + uint8_t response = self->cmd_response; + common_hal_mcu_enable_interrupts(); + + if (has_response) { + return response; + } + } + + /* No response */ + common_hal_mcu_disable_interrupts(); + self->waiting_cmd_response = false; + self->last_errors |= ERROR_TX_NORESP; + common_hal_mcu_enable_interrupts(); + return -1; + + /* Other errors */ +ERROR: + idle(self); + resume_interrupt(self); + return -1; +} diff --git a/ports/atmel-samd/common-hal/ps2io/Ps2.h b/ports/atmel-samd/common-hal/ps2io/Ps2.h new file mode 100644 index 000000000..cce6ae474 --- /dev/null +++ b/ports/atmel-samd/common-hal/ps2io/Ps2.h @@ -0,0 +1,62 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Elvis Pfutzenreuter + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PS2IO_PS2_H +#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PS2IO_PS2_H + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + uint8_t channel; + uint8_t clk_pin; + uint8_t data_pin; + + uint8_t state; + uint64_t last_int_ms; + uint32_t last_int_us; + + uint16_t bits; + bool parity; + uint8_t bitcount; + + uint8_t buffer[16]; + uint8_t bufcount; + uint8_t bufposr; + uint8_t bufposw; + + uint16_t last_errors; + + bool waiting_cmd_response; + uint8_t cmd_response; +} ps2io_ps2_obj_t; + +void ps2_interrupt_handler(uint8_t channel); + +#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PS2IO_PS2_H diff --git a/ports/atmel-samd/common-hal/ps2io/__init__.c b/ports/atmel-samd/common-hal/ps2io/__init__.c new file mode 100644 index 000000000..ba4b4249f --- /dev/null +++ b/ports/atmel-samd/common-hal/ps2io/__init__.c @@ -0,0 +1 @@ +// No ps2io module functions. diff --git a/ports/atmel-samd/eic_handler.c b/ports/atmel-samd/eic_handler.c index db5f260e5..30ecaa7ca 100644 --- a/ports/atmel-samd/eic_handler.c +++ b/ports/atmel-samd/eic_handler.c @@ -25,6 +25,7 @@ */ #include "common-hal/pulseio/PulseIn.h" +#include "common-hal/ps2io/Ps2.h" #include "common-hal/rotaryio/IncrementalEncoder.h" #include "shared-bindings/microcontroller/__init__.h" //#include "samd/external_interrupts.h" @@ -46,6 +47,12 @@ void shared_eic_handler(uint8_t channel) { break; #endif +#if CIRCUITPY_PS2IO + case EIC_HANDLER_PS2: + ps2_interrupt_handler(channel); + break; +#endif + #if CIRCUITPY_ROTARYIO case EIC_HANDLER_INCREMENTAL_ENCODER: incrementalencoder_interrupt_handler(channel); diff --git a/ports/atmel-samd/eic_handler.h b/ports/atmel-samd/eic_handler.h index 2f9ccd67f..71b0fce67 100644 --- a/ports/atmel-samd/eic_handler.h +++ b/ports/atmel-samd/eic_handler.h @@ -29,6 +29,7 @@ #define EIC_HANDLER_NO_INTERRUPT 0x0 #define EIC_HANDLER_PULSEIN 0x1 #define EIC_HANDLER_INCREMENTAL_ENCODER 0x2 +#define EIC_HANDLER_PS2 0x3 void set_eic_handler(uint8_t channel, uint8_t eic_handler); void shared_eic_handler(uint8_t channel); diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 4f53d30f9..37360deb0 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -52,6 +52,7 @@ #include "common-hal/pulseio/PulseIn.h" #include "common-hal/pulseio/PulseOut.h" #include "common-hal/pulseio/PWMOut.h" +#include "common-hal/ps2io/Ps2.h" #include "common-hal/rtc/RTC.h" #include "common-hal/touchio/TouchIn.h" #include "samd/cache.h" diff --git a/ports/atmel-samd/tools/gen_pin_name_table.py b/ports/atmel-samd/tools/gen_pin_name_table.py index 76c9cf255..ded64e5f6 100644 --- a/ports/atmel-samd/tools/gen_pin_name_table.py +++ b/ports/atmel-samd/tools/gen_pin_name_table.py @@ -156,6 +156,9 @@ capabilities = { "PA14", "PA15", "PA16", "PA17", "PA18", "PA19", "PA20", "PA21", "PA22", "PA23", "PA30", "PA31"] }, + "ps2io": { + "Ps2": ALL_BUT_USB, + }, "touchio": { "TouchIn": ["PA02", "PA03", "PB08", "PB09", "PA04", "PA05", "PA06", "PA07", "PB02", "PB03"] diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 1aca33901..722f06e93 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -162,6 +162,9 @@ endif ifeq ($(CIRCUITPY_PULSEIO),1) SRC_PATTERNS += pulseio/% endif +ifeq ($(CIRCUITPY_PS2IO),1) +SRC_PATTERNS += ps2io/% +endif ifeq ($(CIRCUITPY_RANDOM),1) SRC_PATTERNS += random/% endif @@ -252,6 +255,8 @@ $(filter $(SRC_PATTERNS), \ pulseio/PulseIn.c \ pulseio/PulseOut.c \ pulseio/__init__.c \ + ps2io/Ps2.c \ + ps2io/__init__.c \ rotaryio/IncrementalEncoder.c \ rotaryio/__init__.c \ rtc/RTC.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 0575bcfe0..c794759f8 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -416,6 +416,13 @@ extern const struct _mp_obj_module_t pulseio_module; #define PULSEIO_MODULE #endif +#if CIRCUITPY_PS2IO +extern const struct _mp_obj_module_t ps2io_module; +#define PS2IO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_ps2io), (mp_obj_t)&ps2io_module }, +#else +#define PS2IO_MODULE +#endif + #if CIRCUITPY_RANDOM extern const struct _mp_obj_module_t random_module; #define RANDOM_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_random), (mp_obj_t)&random_module }, @@ -580,6 +587,7 @@ extern const struct _mp_obj_module_t ustack_module; PEW_MODULE \ PIXELBUF_MODULE \ PULSEIO_MODULE \ + PS2IO_MODULE \ RANDOM_MODULE \ RE_MODULE \ ROTARYIO_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index b436929e0..ed9b9f461 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -153,6 +153,12 @@ CIRCUITPY_PULSEIO = 1 endif CFLAGS += -DCIRCUITPY_PULSEIO=$(CIRCUITPY_PULSEIO) +# Only for SAMD boards for the moment +ifndef CIRCUITPY_PS2IO +CIRCUITPY_PS2IO = 0 +endif +CFLAGS += -DCIRCUITPY_PS2IO=$(CIRCUITPY_PS2IO) + ifndef CIRCUITPY_RANDOM CIRCUITPY_RANDOM = 1 endif diff --git a/shared-bindings/index.rst b/shared-bindings/index.rst index 4f2e28702..8f9bbbb31 100644 --- a/shared-bindings/index.rst +++ b/shared-bindings/index.rst @@ -53,6 +53,7 @@ Module Supported Ports `nvm` **SAMD Express** `os` **All Supported** `pulseio` **SAMD/SAMD Express** +`ps2io` **SAMD/SAMD Express** `random` **All Supported** `rotaryio` **SAMD51, SAMD Express** `storage` **All Supported** diff --git a/shared-bindings/ps2io/Ps2.c b/shared-bindings/ps2io/Ps2.c new file mode 100644 index 000000000..bdbbf795c --- /dev/null +++ b/shared-bindings/ps2io/Ps2.c @@ -0,0 +1,237 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Elvis Pfutzenreuter + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "lib/utils/context_manager_helpers.h" +#include "py/objproperty.h" +#include "py/runtime.h" +#include "py/runtime0.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/ps2io/Ps2.h" +#include "shared-bindings/util.h" +#include "supervisor/shared/translate.h" + +//| .. currentmodule:: ps2io +//| +//| :class:`Ps2` -- Communicate with a PS/2 keyboard or mouse +//| ========================================================= +//| +//| Ps2 implements the PS/2 keyboard/mouse serial protocol, used in +//| legacy devices. It is similar to UART but there are only two +//| lines (Data and Clock). PS/2 devices are 5V, so bidirectional +//| level converters must be used to connect the I/O lines to pins +//| of 3.3V boards. +//| +//| .. class:: Ps2(data_pin, clock_pin) +//| +//| Create a Ps2 object associated with the given pins. +//| +//| :param ~microcontroller.Pin data_pin: Pin tied to data wire. +//| :param ~microcontroller.Pin clock_pin: Pin tied to clock wire. +//| This pin must support interrupts. +//| +//| Read one byte from PS/2 keyboard and turn on Scroll Lock LED:: +//| +//| import ps2io +//| import board +//| +//| kbd = ps2io.Ps2(board.D10, board.D11) +//| +//| while len(kbd) == 0: +//| pass +//| +//| print(kbd.popleft()) +//| print(kbd.sendcmd(0xed)) +//| print(kbd.sendcmd(0x01)) +//| +STATIC mp_obj_t ps2io_ps2_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_datapin, ARG_clkpin }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_datapin, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_clkpin, MP_ARG_REQUIRED | MP_ARG_OBJ }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + assert_pin(args[ARG_clkpin].u_obj, false); + assert_pin(args[ARG_datapin].u_obj, false); + const mcu_pin_obj_t* clkpin = MP_OBJ_TO_PTR(args[ARG_clkpin].u_obj); + assert_pin_free(clkpin); + const mcu_pin_obj_t* datapin = MP_OBJ_TO_PTR(args[ARG_datapin].u_obj); + assert_pin_free(datapin); + + ps2io_ps2_obj_t *self = m_new_obj(ps2io_ps2_obj_t); + self->base.type = &ps2io_ps2_type; + + common_hal_ps2io_ps2_construct(self, datapin, clkpin); + + return MP_OBJ_FROM_PTR(self); +} + +//| .. method:: deinit() +//| +//| Deinitialises the Ps2 and releases any hardware resources for reuse. +//| +STATIC mp_obj_t ps2io_ps2_deinit(mp_obj_t self_in) { + ps2io_ps2_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_ps2io_ps2_deinit(self); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(ps2io_ps2_deinit_obj, ps2io_ps2_deinit); + +//| .. method:: __enter__() +//| +//| No-op used by Context Managers. +//| +// Provided by context manager helper. + +//| .. method:: __exit__() +//| +//| Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info. +//| +STATIC mp_obj_t ps2io_ps2_obj___exit__(size_t n_args, const mp_obj_t *args) { + (void)n_args; + common_hal_ps2io_ps2_deinit(args[0]); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ps2io_ps2___exit___obj, 4, 4, ps2io_ps2_obj___exit__); + +//| .. method:: popleft() +//| +//| Removes and returns the oldest received byte. When buffer +//| is empty, raises an IndexError exception. +//| +STATIC mp_obj_t ps2io_ps2_obj_popleft(mp_obj_t self_in) { + ps2io_ps2_obj_t *self = MP_OBJ_TO_PTR(self_in); + raise_error_if_deinited(common_hal_ps2io_ps2_deinited(self)); + + int b = common_hal_ps2io_ps2_popleft(self); + if (b < 0) { + mp_raise_IndexError(translate("Pop from an empty Ps2 buffer")); + } + return MP_OBJ_NEW_SMALL_INT(b); +} +MP_DEFINE_CONST_FUN_OBJ_1(ps2io_ps2_popleft_obj, ps2io_ps2_obj_popleft); + +//| .. method:: sendcmd(byte) +//| +//| Sends a command byte to PS/2. Returns the response byte, typically +//| the general ack value (0xFA). Some commands return additional data +//| which is available through :py:func:`popleft()`. +//| +//| Raises a RuntimeError in case of failure. The root cause can be found +//| by calling :py:func:`clear_errors()`. It is advisable to call +//| :py:func:`clear_errors()` before :py:func:`sendcmd()` to flush any +//| previous errors. +//| +//| :param int byte: byte value of the command +//| +STATIC mp_obj_t ps2io_ps2_obj_sendcmd(mp_obj_t self_in, mp_obj_t ob) { + ps2io_ps2_obj_t *self = MP_OBJ_TO_PTR(self_in); + raise_error_if_deinited(common_hal_ps2io_ps2_deinited(self)); + mp_int_t cmd = mp_obj_get_int(ob) & 0xff; + int resp = common_hal_ps2io_ps2_sendcmd(self, cmd); + if (resp < 0) { + mp_raise_RuntimeError(translate("Failed sending command.")); + } + return MP_OBJ_NEW_SMALL_INT(resp); +} +MP_DEFINE_CONST_FUN_OBJ_2(ps2io_ps2_sendcmd_obj, ps2io_ps2_obj_sendcmd); + +//| .. method:: clear_errors() +//| +//| Returns and clears a bitmap with latest recorded communication errors. +//| +//| Reception errors (arise asynchronously, as data is received): +//| +//| 0x01: start bit not 0 +//| +//| 0x02: timeout +//| +//| 0x04: parity bit error +//| +//| 0x08: stop bit not 1 +//| +//| 0x10: buffer overflow, newest data discarded +//| +//| Transmission errors (can only arise in the course of sendcmd()): +//| +//| 0x100: clock pin didn't go to LO in time +//| +//| 0x200: clock pin didn't go to HI in time +//| +//| 0x400: data pin didn't ACK +//| +//| 0x800: clock pin didn't ACK +//| +//| 0x1000: device didn't respond to RTS +//| +//| 0x2000: device didn't send a response byte in time +//| +STATIC mp_obj_t ps2io_ps2_obj_clear_errors(mp_obj_t self_in) { + ps2io_ps2_obj_t *self = MP_OBJ_TO_PTR(self_in); + raise_error_if_deinited(common_hal_ps2io_ps2_deinited(self)); + + return MP_OBJ_NEW_SMALL_INT(common_hal_ps2io_ps2_clear_errors(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(ps2io_ps2_clear_errors_obj, ps2io_ps2_obj_clear_errors); + +//| .. method:: __len__() +//| +//| Returns the number of received bytes in buffer, available +//| to :py:func:`popleft()`. +//| +STATIC mp_obj_t ps2_unary_op(mp_unary_op_t op, mp_obj_t self_in) { + ps2io_ps2_obj_t *self = MP_OBJ_TO_PTR(self_in); + raise_error_if_deinited(common_hal_ps2io_ps2_deinited(self)); + uint16_t len = common_hal_ps2io_ps2_get_len(self); + switch (op) { + case MP_UNARY_OP_BOOL: return mp_obj_new_bool(len != 0); + case MP_UNARY_OP_LEN: return MP_OBJ_NEW_SMALL_INT(len); + default: return MP_OBJ_NULL; // op not supported + } +} + +STATIC const mp_rom_map_elem_t ps2io_ps2_locals_dict_table[] = { + // Methods + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&ps2io_ps2_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&ps2io_ps2___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR_popleft), MP_ROM_PTR(&ps2io_ps2_popleft_obj) }, + { MP_ROM_QSTR(MP_QSTR_sendcmd), MP_ROM_PTR(&ps2io_ps2_sendcmd_obj) }, + { MP_ROM_QSTR(MP_QSTR_clear_errors), MP_ROM_PTR(&ps2io_ps2_clear_errors_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(ps2io_ps2_locals_dict, ps2io_ps2_locals_dict_table); + +const mp_obj_type_t ps2io_ps2_type = { + { &mp_type_type }, + .name = MP_QSTR_Ps2, + .make_new = ps2io_ps2_make_new, + .unary_op = ps2_unary_op, + .locals_dict = (mp_obj_dict_t*)&ps2io_ps2_locals_dict, +}; diff --git a/shared-bindings/ps2io/Ps2.h b/shared-bindings/ps2io/Ps2.h new file mode 100644 index 000000000..523869d55 --- /dev/null +++ b/shared-bindings/ps2io/Ps2.h @@ -0,0 +1,45 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Elvis Pfutzenreuter + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_PS2IO_PS2_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_PS2IO_PS2_H + +#include "common-hal/microcontroller/Pin.h" +#include "common-hal/ps2io/Ps2.h" + +extern const mp_obj_type_t ps2io_ps2_type; + +extern void common_hal_ps2io_ps2_construct(ps2io_ps2_obj_t* self, + const mcu_pin_obj_t* data_pin, const mcu_pin_obj_t* clk_pin); +extern void common_hal_ps2io_ps2_deinit(ps2io_ps2_obj_t* self); +extern bool common_hal_ps2io_ps2_deinited(ps2io_ps2_obj_t* self); +extern uint16_t common_hal_ps2io_ps2_get_len(ps2io_ps2_obj_t* self); +extern int16_t common_hal_ps2io_ps2_popleft(ps2io_ps2_obj_t* self); +extern int16_t common_hal_ps2io_ps2_sendcmd(ps2io_ps2_obj_t* self, uint8_t b); +extern uint16_t common_hal_ps2io_ps2_clear_errors(ps2io_ps2_obj_t* self); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_PS2IO_PS2_H diff --git a/shared-bindings/ps2io/__init__.c b/shared-bindings/ps2io/__init__.c new file mode 100644 index 000000000..ec7c43e51 --- /dev/null +++ b/shared-bindings/ps2io/__init__.c @@ -0,0 +1,73 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Elvis Pfutzenreuter + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/ps2io/Ps2.h" + +//| :mod:`ps2io` --- Support for PS/2 protocol +//| ===================================================== +//| +//| .. module:: ps2io +//| :synopsis: Support for PS/2 based devices +//| :platform: SAMD21 +//| +//| The `ps2io` module contains classes to provide PS/2 communication. +//| +//| Libraries +//| +//| .. toctree:: +//| :maxdepth: 3 +//| +//| Ps2 +//| + +//| .. warning:: This module is not available in some SAMD21 builds. See the +//| :ref:`module-support-matrix` for more info. +//| + +//| All classes change hardware state and should be deinitialized when they +//| are no longer needed if the program continues after use. To do so, either +//| call :py:meth:`!deinit` or use a context manager. See +//| :ref:`lifetime-and-contextmanagers` for more info. +//| + +STATIC const mp_rom_map_elem_t ps2io_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_ps2io) }, + { MP_ROM_QSTR(MP_QSTR_Ps2), MP_ROM_PTR(&ps2io_ps2_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(ps2io_module_globals, ps2io_module_globals_table); + +const mp_obj_module_t ps2io_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&ps2io_module_globals, +}; diff --git a/shared-bindings/ps2io/__init__.h b/shared-bindings/ps2io/__init__.h new file mode 100644 index 000000000..1ff3d97b5 --- /dev/null +++ b/shared-bindings/ps2io/__init__.h @@ -0,0 +1,35 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * Copyright (c) 2019 Elvis Pfutzenreuter + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_PS2IO___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_PS2IO___INIT___H + +#include "py/obj.h" + +// Nothing now. + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_PS2IO___INIT___H -- cgit v1.2.3 From 62de2506e47c14a71c7a9fe04360697ccb966aeb Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 6 Jun 2019 17:49:32 -0400 Subject: Include display objects in gc. --- main.c | 5 +++++ ports/nrf/background.c | 4 ++-- ports/nrf/supervisor/port.c | 10 ++++++++-- py/gc.c | 4 ++++ py/gc.h | 1 + shared-bindings/board/__init__.c | 1 - shared-module/board/__init__.c | 2 +- shared-module/displayio/__init__.c | 16 ++++++++++++++-- shared-module/displayio/__init__.h | 1 + 9 files changed, 36 insertions(+), 8 deletions(-) (limited to 'py') diff --git a/main.c b/main.c index 107b5b3c2..6d7502ba4 100755 --- a/main.c +++ b/main.c @@ -455,6 +455,11 @@ void gc_collect(void) { // This collects root pointers from the VFS mount table. Some of them may // have lost their references in the VM even though they are mounted. gc_collect_root((void**)&MP_STATE_VM(vfs_mount_table), sizeof(mp_vfs_mount_t) / sizeof(mp_uint_t)); + + #if CIRCUITPY_DISPLAYIO + displayio_gc_collect(); + #endif + // This naively collects all object references from an approximate stack // range. gc_collect_root((void**)sp, ((uint32_t)&_estack - sp) / sizeof(uint32_t)); diff --git a/ports/nrf/background.c b/ports/nrf/background.c index 3fb5febd3..9c4f3ab27 100644 --- a/ports/nrf/background.c +++ b/ports/nrf/background.c @@ -29,7 +29,7 @@ #include "supervisor/usb.h" #include "supervisor/shared/stack.h" -#ifdef CIRCUITPY_DISPLAYIO +#if CIRCUITPY_DISPLAYIO #include "shared-module/displayio/__init__.h" #endif @@ -48,7 +48,7 @@ void run_background_tasks(void) { filesystem_background(); usb_background(); - #ifdef CIRCUITPY_DISPLAYIO + #if CIRCUITPY_DISPLAYIO displayio_refresh_displays(); #endif running_background_tasks = false; diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 85ecd6afe..8fbf75498 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -93,16 +93,22 @@ void reset_port(void) { i2c_reset(); spi_reset(); uart_reset(); + +#if CIRCUITPY_PULSEIO pwmout_reset(); pulseout_reset(); pulsein_reset(); +#endif + timers_reset(); - #if CIRCUITPY_RTC +#if CIRCUITPY_RTC rtc_reset(); - #endif +#endif +#if CIRCUITPY_BLEIO bleio_reset(); +#endif reset_all_pins(); } diff --git a/py/gc.c b/py/gc.c index e9b85fa7c..10b36950c 100755 --- a/py/gc.c +++ b/py/gc.c @@ -383,6 +383,10 @@ void gc_collect_start(void) { #endif } +void gc_collect_ptr(void *ptr) { + gc_mark(ptr); +} + void gc_collect_root(void **ptrs, size_t len) { for (size_t i = 0; i < len; i++) { void *ptr = ptrs[i]; diff --git a/py/gc.h b/py/gc.h index 757a2a6e0..02bf45158 100644 --- a/py/gc.h +++ b/py/gc.h @@ -43,6 +43,7 @@ bool gc_is_locked(void); // A given port must implement gc_collect by using the other collect functions. void gc_collect(void); void gc_collect_start(void); +void gc_collect_ptr(void *ptr); void gc_collect_root(void **ptrs, size_t len); void gc_collect_end(void); diff --git a/shared-bindings/board/__init__.c b/shared-bindings/board/__init__.c index 82a0cab67..448b397ab 100644 --- a/shared-bindings/board/__init__.c +++ b/shared-bindings/board/__init__.c @@ -34,7 +34,6 @@ //| //| .. module:: board //| :synopsis: Board specific pin names -//| :platform: SAMD21 //| //| Common container for board base pin names. These will vary from board to //| board so don't expect portability when using this module. diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index ac4de2fe5..be8502bc0 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -103,7 +103,7 @@ void reset_board_busses(void) { #endif #if BOARD_SPI bool display_using_spi = false; - #ifdef CIRCUITPY_DISPLAYIO + #if CIRCUITPY_DISPLAYIO for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { if (displays[i].fourwire_bus.bus == spi_singleton) { display_using_spi = true; diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index 156640440..3b98536e9 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -3,6 +3,7 @@ #include "shared-module/displayio/__init__.h" #include "lib/utils/interrupt_char.h" +#include "py/gc.h" #include "py/reload.h" #include "py/runtime.h" #include "shared-bindings/board/__init__.h" @@ -181,7 +182,6 @@ void common_hal_displayio_release_displays(void) { } void reset_displays(void) { - #if CIRCUITPY_DISPLAYIO // The SPI buses used by FourWires may be allocated on the heap so we need to move them inline. for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { if (displays[i].fourwire_bus.base.type != &displayio_fourwire_type) { @@ -218,5 +218,17 @@ void reset_displays(void) { display->auto_brightness = true; common_hal_displayio_display_show(display, &circuitpython_splash); } - #endif +} + +void displayio_gc_collect(void) { + for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { + if (displays[i].display.base.type == NULL) { + continue; + } + + // Alternatively, we could use gc_collect_root over the whole object, + // but this is more precise, and is the only field that needs marking. + gc_collect_ptr(displays[i].display.current_group); + + } } diff --git a/shared-module/displayio/__init__.h b/shared-module/displayio/__init__.h index 5b56ed55c..de021276c 100644 --- a/shared-module/displayio/__init__.h +++ b/shared-module/displayio/__init__.h @@ -46,5 +46,6 @@ extern displayio_group_t circuitpython_splash; void displayio_refresh_displays(void); void reset_displays(void); +void displayio_gc_collect(void); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO___INIT___H -- cgit v1.2.3 From ea760c042bcdff61792a4b5f3de0b3ec212c44c4 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 11 Jun 2019 12:43:48 -0400 Subject: Turn on MICROPY_OPT_COMPUTED_GOTO for 5x CPU-bound speedup --- py/circuitpy_mpconfig.h | 1 + py/vmentrytable.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'py') diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index c794759f8..2026185ef 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -72,6 +72,7 @@ #define MICROPY_KBD_EXCEPTION (1) #define MICROPY_MEM_STATS (0) #define MICROPY_NONSTANDARD_TYPECODES (0) +#define MICROPY_OPT_COMPUTED_GOTO (1) #define MICROPY_PERSISTENT_CODE_LOAD (1) #define MICROPY_PY_ARRAY (1) diff --git a/py/vmentrytable.h b/py/vmentrytable.h index 615f4e2ce..a0e2d4065 100644 --- a/py/vmentrytable.h +++ b/py/vmentrytable.h @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#if __clang__ +#ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winitializer-overrides" #endif // __clang__ @@ -113,6 +113,6 @@ static const void *const entry_table[256] = { [MP_BC_BINARY_OP_MULTI ... MP_BC_BINARY_OP_MULTI + MP_BINARY_OP_NUM_BYTECODE - 1] = &&entry_MP_BC_BINARY_OP_MULTI, }; -#if __clang__ +#ifdef __clang__ #pragma clang diagnostic pop #endif // __clang__ -- cgit v1.2.3 From 1bb4fccc3b28edd1010013b3043e419ec2940f7f Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 12 Jun 2019 11:08:22 -0400 Subject: Turn off SUPEROPT on gc.c instead of trying to squueze inline limit so much; reorganize mpconfigboard.mk files --- ports/atmel-samd/Makefile | 10 ++++++++-- .../boards/arduino_mkr1300/mpconfigboard.mk | 12 ++++-------- .../boards/arduino_mkrzero/mpconfigboard.mk | 11 ++++------- ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk | 11 ++++------- .../boards/bast_pro_mini_m0/mpconfigboard.mk | 6 +++--- .../boards/capablerobot_usbhub/mpconfigboard.mk | 6 +++--- .../boards/catwan_usbstick/mpconfigboard.mk | 6 +++--- .../boards/circuitplayground_express/mpconfigboard.mk | 15 ++++----------- .../mpconfigboard.mk | 19 ++++++------------- ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk | 13 ++++++------- .../atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk | 13 +++++-------- .../boards/escornabot_makech/mpconfigboard.mk | 11 ++++------- .../boards/feather_m0_adalogger/mpconfigboard.mk | 11 ++++------- .../boards/feather_m0_basic/mpconfigboard.mk | 11 ++++------- .../boards/feather_m0_express/mpconfigboard.mk | 10 +++------- .../feather_m0_express_crickit/mpconfigboard.mk | 10 ++++------ .../boards/feather_m0_rfm69/mpconfigboard.mk | 11 ++++------- .../boards/feather_m0_rfm9x/mpconfigboard.mk | 11 ++++------- .../boards/feather_m0_supersized/mpconfigboard.mk | 6 +++--- .../boards/feather_m4_express/mpconfigboard.mk | 13 +++++-------- .../boards/feather_radiofruit_zigbee/mpconfigboard.mk | 6 +++--- ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk | 11 ++++------- .../boards/grandcentral_m4_express/mpconfigboard.mk | 10 ++++------ .../boards/hallowing_m0_express/mpconfigboard.mk | 9 ++++----- .../boards/itsybitsy_m0_express/mpconfigboard.mk | 14 ++++---------- .../boards/itsybitsy_m4_express/mpconfigboard.mk | 9 ++++----- .../atmel-samd/boards/kicksat-sprite/mpconfigboard.mk | 7 ++++--- ports/atmel-samd/boards/meowmeow/mpconfigboard.mk | 11 ++++------- .../boards/metro_m0_express/mpconfigboard.mk | 13 ++++--------- .../boards/metro_m4_airlift_lite/mpconfigboard.mk | 13 +++++-------- .../boards/metro_m4_express/mpconfigboard.mk | 13 +++++-------- ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk | 10 ++++------ ports/atmel-samd/boards/pewpew10/mpconfigboard.mk | 18 ++++++------------ ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk | 10 +++++----- ports/atmel-samd/boards/pybadge/mpconfigboard.mk | 18 ++++++++---------- ports/atmel-samd/boards/pygamer/mpconfigboard.mk | 18 ++++++++---------- ports/atmel-samd/boards/pyportal/mpconfigboard.mk | 7 +++---- ports/atmel-samd/boards/robohatmm1/mpconfigboard.mk | 13 ++++++------- ports/atmel-samd/boards/sam32/mpconfigboard.mk | 6 +++--- .../boards/sparkfun_lumidrive/mpconfigboard.mk | 11 +++++------ .../boards/sparkfun_redboard_turbo/mpconfigboard.mk | 11 +++-------- .../boards/sparkfun_samd21_dev/mpconfigboard.mk | 11 ++++------- .../boards/sparkfun_samd21_mini/mpconfigboard.mk | 11 ++++------- .../boards/trellis_m4_express/mpconfigboard.mk | 9 ++++----- ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk | 11 ++++------- .../boards/trinket_m0_haxpress/mpconfigboard.mk | 6 +++--- ports/atmel-samd/boards/uchip/mpconfigboard.mk | 6 +++--- ports/atmel-samd/boards/ugame10/mpconfigboard.mk | 6 +++--- py/circuitpy_mpconfig.mk | 14 +++++++------- py/py.mk | 19 ++++++++++++++++--- 50 files changed, 229 insertions(+), 318 deletions(-) (limited to 'py') diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 3a8ad4acc..1df782dab 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -111,12 +111,18 @@ else # -finline-limit can shrink the image size. # -finline-limit=80 or so is similar to not having it on. # There is no simple default value, though. - ifeq ($(INTERNAL_FLASH_FILESYSTEM),1) - CFLAGS += -finline-limit=50 + + # Do a default shrink for small builds. + ifndef CFLAGS_INLINE_LIMIT + ifeq ($(CIRCUITPY_SMALL_BUILD),1) + CFLAGS_INLINE_LIMIT = 50 + endif endif + ifdef CFLAGS_INLINE_LIMIT CFLAGS += -finline-limit=$(CFLAGS_INLINE_LIMIT) endif + CFLAGS += -flto endif diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk index e7171181b..a543468e5 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk @@ -4,14 +4,10 @@ USB_PID = 0x8053 USB_PRODUCT = "Arduino MKR1300" USB_MANUFACTURER = "Arduino" -INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 - CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 -ifeq ($(TRANSLATION), zh_Latn_pinyin) -CFLAGS_INLINE_LIMIT = 23 -RELEASE_NEEDS_CLEAN_BUILD = 1 -endif +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE +CIRCUITPY_SMALL_BUILD = 1 +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk index 49436a0b3..5612eb88d 100644 --- a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk @@ -4,14 +4,11 @@ USB_PID = 0x8050 USB_PRODUCT = "Arduino MKRZero" USB_MANUFACTURER = "Arduino" +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 - -ifeq ($(TRANSLATION), zh_Latn_pinyin) -CFLAGS_INLINE_LIMIT = 23 -RELEASE_NEEDS_CLEAN_BUILD = 1 -endif +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk index 9b4de5688..cbbf15a3e 100644 --- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk @@ -4,14 +4,11 @@ USB_PID = 0x824D USB_PRODUCT = "Arduino Zero" USB_MANUFACTURER = "Arduino" +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 - -ifeq ($(TRANSLATION), zh_Latn_pinyin) -CFLAGS_INLINE_LIMIT = 23 -RELEASE_NEEDS_CLEAN_BUILD = 1 -endif +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk index 0e9bf7b45..08e42aa4e 100644 --- a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk @@ -4,9 +4,9 @@ USB_PID = 0xBAB3 USB_PRODUCT = "Bast Pro Mini M0" USB_MANUFACTURER = "Electronic Cats" +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 - -CHIP_VARIANT = SAMD21E18A -CHIP_FAMILY = samd21 diff --git a/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.mk b/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.mk index 88a059dcf..97c8eb863 100644 --- a/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.mk +++ b/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.mk @@ -4,6 +4,9 @@ USB_PID = 0xEDB3 USB_PRODUCT = "Programmable USB Hub" USB_MANUFACTURER = "Capable Robot Components" +CHIP_VARIANT = SAMD51G19A +CHIP_FAMILY = samd51 + QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = GD25Q16C @@ -13,6 +16,3 @@ LONGINT_IMPL = MPZ CIRCUITPY_AUDIOBUSIO = 0 # No touch on SAMD51 yet CIRCUITPY_TOUCHIO = 0 - -CHIP_VARIANT = SAMD51G19A -CHIP_FAMILY = samd51 diff --git a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk index 9cdfca5b1..2399aad5c 100644 --- a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk +++ b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk @@ -4,9 +4,9 @@ USB_PID = 0xBAB2 USB_PRODUCT = "CatWAN USBStick" USB_MANUFACTURER = "Electronic Cats" +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 - -CHIP_VARIANT = SAMD21E18A -CHIP_FAMILY = samd21 diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk index 1d0f196b4..6d2bece5d 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk @@ -4,6 +4,9 @@ USB_PID = 0x8019 USB_PRODUCT = "CircuitPlayground Express" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" @@ -13,9 +16,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 - -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 +SUPEROPT_GC = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice @@ -24,11 +25,3 @@ FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Thermistor - -# Tweak inlining depending on language. -ifeq ($(TRANSLATION), zh_Latn_pinyin) -CFLAGS_INLINE_LIMIT = 23 -RELEASE_NEEDS_CLEAN_BUILD = 1 -else -CFLAGS_INLINE_LIMIT = 35 -endif diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk index 5dd0c3f10..b80142b01 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk @@ -4,27 +4,20 @@ USB_PID = 0x8019 USB_PRODUCT = "CircuitPlayground Express with Crickit libraries" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" -# Turn off longints for Crickit build to make room for additional frozen libs. -LONGINT_IMPL = NONE +# Turn off features and optimizations for Crickit build to make room for additional frozen libs. +LONGINT_IMPL = NONE CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 - -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 - -# Tweak inlining depending on language. -ifeq ($(TRANSLATION), zh_Latn_pinyin) -CFLAGS_INLINE_LIMIT = 23 -RELEASE_NEEDS_CLEAN_BUILD = 1 -else -CFLAGS_INLINE_LIMIT = 35 -endif +SUPEROPT_GC = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice diff --git a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk index c566795c4..72a191044 100644 --- a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk @@ -4,16 +4,15 @@ USB_PID = 0x8021 USB_PRODUCT = "CP32-M4" USB_MANUFACTURER = "Nadda-Reel Company LLC" +CHIP_VARIANT = SAMD51J20A +CHIP_FAMILY = samd51 + QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "W25Q128JV_PM" -# No I2S on SAMD51G +CIRCUITPY_PS2IO = 1 +# No I2S on SAMD51G. CIRCUITPY_AUDIOBUSIO = 0 -# No touch on SAMD51 yet +# No touch on SAMD51 yet. CIRCUITPY_TOUCHIO = 0 - -CHIP_VARIANT = SAMD51J20A -CHIP_FAMILY = samd51 - -CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk index af1037c38..794920fe3 100644 --- a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk @@ -4,19 +4,16 @@ USB_PID = 0x0001 USB_PRODUCT = "Datalore IP M4" USB_MANUFACTURER = "TG-Boards" +CHIP_VARIANT = SAMD51J19A +CHIP_FAMILY = samd51 + QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 3 EXTERNAL_FLASH_DEVICES = "GD25Q16C, W25Q16JV_IQ, W25Q16JV_IM" - LONGINT_IMPL = MPZ -CHIP_VARIANT = SAMD51J19A -CHIP_FAMILY = samd51 - -# No touch on SAMD51 yet -CIRCUITPY_TOUCHIO = 0 - CIRCUITPY_NETWORK = 1 MICROPY_PY_WIZNET5K = 5500 - CIRCUITPY_PS2IO = 1 +# No touch on SAMD51 yet +CIRCUITPY_TOUCHIO = 0 diff --git a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk index 8d2801149..a2c182e68 100644 --- a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk +++ b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk @@ -4,14 +4,11 @@ USB_PID = 0xBAB6 USB_PRODUCT = "Escornabot Makech" USB_MANUFACTURER = "Electronic Cats" +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 - -ifeq ($(TRANSLATION), zh_Latn_pinyin) -CFLAGS_INLINE_LIMIT = 23 -RELEASE_NEEDS_CLEAN_BUILD = 1 -endif +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk index b21fd8589..a88dbd563 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk @@ -4,14 +4,11 @@ USB_PID = 0x8015 USB_PRODUCT = "Feather M0 Adalogger" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 - -ifeq ($(TRANSLATION), zh_Latn_pinyin) -CFLAGS_INLINE_LIMIT = 23 -RELEASE_NEEDS_CLEAN_BUILD = 1 -endif +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk index 400286228..076f1f8ff 100644 --- a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk @@ -4,14 +4,11 @@ USB_PID = 0x8015 USB_PRODUCT = "Feather M0" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 - -ifeq ($(TRANSLATION), zh_Latn_pinyin) -CFLAGS_INLINE_LIMIT = 23 -RELEASE_NEEDS_CLEAN_BUILD = 1 -endif +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk index 64d81c64c..5e321bd3d 100644 --- a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk @@ -4,16 +4,12 @@ USB_PID = 0x8023 USB_PRODUCT = "Feather M0 Express" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" LONGINT_IMPL = MPZ -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 - -# Tweak inlining depending on language. -ifeq ($(TRANSLATION), zh_Latn_pinyin) CFLAGS_INLINE_LIMIT = 60 -RELEASE_NEEDS_CLEAN_BUILD = 1 -endif diff --git a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk index 620a0d505..5793d82e5 100644 --- a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk @@ -4,6 +4,9 @@ USB_PID = 0x8023 USB_PRODUCT = "Feather M0 Express" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" @@ -14,13 +17,8 @@ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 - -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 - -CFLAGS_INLINE_LIMIT = 50 - CIRCUITPY_GAMEPAD = 0 +CFLAGS_INLINE_LIMIT = 50 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk index edf850a3a..83d794d04 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk @@ -4,14 +4,11 @@ USB_PID = 0x8015 USB_PRODUCT = "Feather M0 RFM69" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 - -ifeq ($(TRANSLATION), zh_Latn_pinyin) -CFLAGS_INLINE_LIMIT = 23 -RELEASE_NEEDS_CLEAN_BUILD = 1 -endif +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk index 0ea5d9a46..a84e14f55 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk @@ -4,14 +4,11 @@ USB_PID = 0x8015 USB_PRODUCT = "Feather M0 RFM9x" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 - -ifeq ($(TRANSLATION), zh_Latn_pinyin) -CFLAGS_INLINE_LIMIT = 23 -RELEASE_NEEDS_CLEAN_BUILD = 1 -endif +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk index 4bae6ffa7..33229044b 100644 --- a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk @@ -4,10 +4,10 @@ USB_PID = 0x8023 USB_PRODUCT = "Feather M0 Supersized" USB_MANUFACTURER = "Dave Astels" +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "S25FL064L" LONGINT_IMPL = MPZ - -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 diff --git a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk index 5972b5e46..8169345f5 100644 --- a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk @@ -4,19 +4,16 @@ USB_PID = 0x8026 USB_PRODUCT = "Feather M4 Express" USB_MANUFACTURER = "Adafruit Industries LLC" -QSPI_FLASH_FILESYSTEM = 1 +CHIP_VARIANT = SAMD51J19A +CHIP_FAMILY = samd51 +QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = GD25Q16C LONGINT_IMPL = MPZ -# No touch on SAMD51 yet -CIRCUITPY_TOUCHIO = 0 - -CHIP_VARIANT = SAMD51J19A -CHIP_FAMILY = samd51 - CIRCUITPY_NETWORK = 1 MICROPY_PY_WIZNET5K = 5500 - CIRCUITPY_PS2IO = 1 +# No touch on SAMD51 yet +CIRCUITPY_TOUCHIO = 0 diff --git a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk index d9350ea22..c4a3a5a19 100755 --- a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk @@ -4,6 +4,9 @@ USB_PID = 0x8023 USB_PRODUCT = "Feather RadioFruit Zigbee" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMR21G18A +CHIP_FAMILY = samd21 + SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" @@ -13,6 +16,3 @@ LONGINT_IMPL = MPZ CIRCUITPY_AUDIOBUSIO = 0 # No DAC on SAMR21G CIRCUITPY_AUDIOIO = 0 - -CHIP_VARIANT = SAMR21G18A -CHIP_FAMILY = samd21 diff --git a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk index 68ed9a937..6f44a22f8 100644 --- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk @@ -4,14 +4,11 @@ USB_PID = 0x801D USB_PRODUCT = "Gemma M0" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 -CHIP_VARIANT = SAMD21E18A -CHIP_FAMILY = samd21 - -ifeq ($(TRANSLATION), zh_Latn_pinyin) -CFLAGS_INLINE_LIMIT = 23 -RELEASE_NEEDS_CLEAN_BUILD = 1 -endif +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk index 0ae23bdef..13631a736 100644 --- a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk @@ -4,16 +4,14 @@ USB_PID = 0x8032 USB_PRODUCT = "Grand Central M4 Express" USB_MANUFACTURER = "Adafruit Industries LLC" -QSPI_FLASH_FILESYSTEM = 1 +CHIP_VARIANT = SAMD51P20A +CHIP_FAMILY = samd51 +QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, GD25Q64C" LONGINT_IMPL = MPZ +CIRCUITPY_PS2IO = 1 # No touch on SAMD51 yet CIRCUITPY_TOUCHIO = 0 - -CHIP_VARIANT = SAMD51P20A -CHIP_FAMILY = samd51 - -CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk index 1df82ff44..8dfc741e5 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk @@ -4,6 +4,9 @@ USB_PID = 0xD1ED USB_PRODUCT = "HalloWing M0 Express" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, GD25Q64C" @@ -13,11 +16,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_AUDIOBUSIO = 0 - -CFLAGS_INLINE_LIMIT = 50 - -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 +SUPEROPT_GC = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice diff --git a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk index 1b2a039b8..bcf3ff655 100644 --- a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk @@ -4,18 +4,12 @@ USB_PID = 0x8012 USB_PRODUCT = "ItsyBitsy M0 Express" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "W25Q16FW, GD25Q16C" LONGINT_IMPL = MPZ -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 - -# Tweak inlining depending on language. -ifeq ($(TRANSLATION), zh_Latn_pinyin) -CFLAGS_INLINE_LIMIT = 45 -RELEASE_NEEDS_CLEAN_BUILD = 1 -else -CFLAGS_INLINE_LIMIT = 70 -endif +CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk index 176935c38..31bb38e20 100644 --- a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk @@ -4,17 +4,16 @@ USB_PID = 0x802C USB_PRODUCT = "ItsyBitsy M4 Express" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMD51G19A +CHIP_FAMILY = samd51 + QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = GD25Q16C LONGINT_IMPL = MPZ +CIRCUITPY_PS2IO = 1 # No I2S on SAMD51G CIRCUITPY_AUDIOBUSIO = 0 # No touch on SAMD51 yet CIRCUITPY_TOUCHIO = 0 - -CHIP_VARIANT = SAMD51G19A -CHIP_FAMILY = samd51 - -CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index e97a70105..5871cca2a 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -4,14 +4,15 @@ USB_PID = 0xED94 USB_PRODUCT = "kicksat-sprite" USB_MANUFACTURER = "maholli" +CHIP_VARIANT = SAMD51G19A +CHIP_FAMILY = samd51 + QSPI_FLASH_FILESYSTEM = 0 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ # No touch on SAMD51 yet CIRCUITPY_TOUCHIO = 0 +# Not needed. CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_DISPLAYIO = 0 - -CHIP_VARIANT = SAMD51G19A -CHIP_FAMILY = samd51 \ No newline at end of file diff --git a/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk b/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk index dc9c3c7a4..894e19a6b 100644 --- a/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk +++ b/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk @@ -4,14 +4,11 @@ USB_PID = 0xBAB1 USB_PRODUCT = "Meow Meow" USB_MANUFACTURER = "Electronic Cats" +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 - -ifeq ($(TRANSLATION), zh_Latn_pinyin) -CFLAGS_INLINE_LIMIT = 23 -RELEASE_NEEDS_CLEAN_BUILD = 1 -endif +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk index ff5284aab..cedee7ef0 100644 --- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk @@ -4,17 +4,12 @@ USB_PID = 0x8014 USB_PRODUCT = "Metro M0 Express" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" - LONGINT_IMPL = MPZ -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 - -# Tweak inlining depending on language. -ifeq ($(TRANSLATION), zh_Latn_pinyin) -CFLAGS_INLINE_LIMIT = 50 -RELEASE_NEEDS_CLEAN_BUILD = 1 -endif +CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk index 2a6191b36..d7d0c1d6e 100644 --- a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk @@ -4,19 +4,16 @@ USB_PID = 0x8038 USB_PRODUCT = "Metro M4 Airlift Lite" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMD51J19A +CHIP_FAMILY = samd51 + QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 3 EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C" - LONGINT_IMPL = MPZ -# No touch on SAMD51 yet -CIRCUITPY_TOUCHIO = 0 - -CHIP_VARIANT = SAMD51J19A -CHIP_FAMILY = samd51 - CIRCUITPY_NETWORK = 1 MICROPY_PY_WIZNET5K = 5500 - CIRCUITPY_PS2IO = 1 +# No touch on SAMD51 yet +CIRCUITPY_TOUCHIO = 0 diff --git a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk index 32e623e67..829bf749f 100644 --- a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk @@ -4,19 +4,16 @@ USB_PID = 0x8021 USB_PRODUCT = "Metro M4 Express" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMD51J19A +CHIP_FAMILY = samd51 + QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 3 EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C" - LONGINT_IMPL = MPZ -# No touch on SAMD51 yet -CIRCUITPY_TOUCHIO = 0 - -CHIP_VARIANT = SAMD51J19A -CHIP_FAMILY = samd51 - CIRCUITPY_NETWORK = 1 MICROPY_PY_WIZNET5K = 5500 - CIRCUITPY_PS2IO = 1 +# No touch on SAMD51 yet +CIRCUITPY_TOUCHIO = 0 diff --git a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk index 5f744dfd2..a8f47dced 100644 --- a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk @@ -4,18 +4,16 @@ USB_PID = 0x2017 USB_PRODUCT = "Mini SAM M4" USB_MANUFACTURER = "Benjamin Shockley" +CHIP_VARIANT = SAMD51G19A +CHIP_FAMILY = samd51 + QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "W25Q16JV_IM" - LONGINT_IMPL = MPZ +CIRCUITPY_PS2IO = 1 # No I2S on SAMD51G CIRCUITPY_AUDIOBUSIO = 0 # No touch on SAMD51 yet CIRCUITPY_TOUCHIO = 0 - -CHIP_VARIANT = SAMD51G19A -CHIP_FAMILY = samd51 - -CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index f9d1dbf58..e24a29051 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -4,13 +4,12 @@ USB_PID = 0x801D USB_PRODUCT = "PewPew 10.2" USB_MANUFACTURER = "Radomir Dopieralski" -INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = NONE - CHIP_VARIANT = SAMD21E18A CHIP_FAMILY = samd21 -FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-standalone-10.x +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE +CIRCUITPY_SMALL_BUILD = 1 CIRCUITPY_PEW = 1 CIRCUITPY_ANALOGIO = 1 @@ -20,12 +19,7 @@ CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_SAMD = 0 CIRCUITPY_USB_MIDI = 0 -CIRCUITPY_SMALL_BUILD = 1 -# Tweak inlining depending on language. -ifeq ($(TRANSLATION), zh_Latn_pinyin) -CFLAGS_INLINE_LIMIT = 23 -RELEASE_NEEDS_CLEAN_BUILD = 1 -else -CFLAGS_INLINE_LIMIT = 35 -endif +SUPEROPT_GC = 0 + +FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-standalone-10.x diff --git a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk index c3f6b3f1e..686c9099f 100644 --- a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk @@ -4,6 +4,9 @@ USB_PID = 0x8028 USB_PRODUCT = "pIRKey M0" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE @@ -19,11 +22,8 @@ CIRCUITPY_SAMD = 0 CIRCUITPY_USB_MIDI = 1 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_SMALL_BUILD = 1 - -CHIP_VARIANT = SAMD21E18A -CHIP_FAMILY = samd21 - -CFLAGS_INLINE_LIMIT = 23 +# Make more room. +SUPEROPT_GC = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar diff --git a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk index bac85b57f..b8d10387b 100644 --- a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk @@ -4,22 +4,20 @@ USB_PID = 0x8034 USB_PRODUCT = "PyBadge" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMD51J19A +CHIP_FAMILY = samd51 + QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = GD25Q16C LONGINT_IMPL = MPZ -# No touch on SAMD51 yet -CIRCUITPY_TOUCHIO = 0 - +CIRCUITPY_AUDIOIO = 1 +CIRCUITPY_DISPLAYIO = 1 +CIRCUITPY_GAMEPAD = 1 CIRCUITPY_GAMEPADSHIFT = 1 - -CHIP_VARIANT = SAMD51J19A -CHIP_FAMILY = samd51 - CIRCUITPY_STAGE = 1 -CIRCUITPY_GAMEPAD = 1 -CIRCUITPY_DISPLAYIO = 1 -CIRCUITPY_AUDIOIO = 1 +# No touch on SAMD51 yet +CIRCUITPY_TOUCHIO = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pybadge diff --git a/ports/atmel-samd/boards/pygamer/mpconfigboard.mk b/ports/atmel-samd/boards/pygamer/mpconfigboard.mk index 179b75a9e..a1ff90747 100644 --- a/ports/atmel-samd/boards/pygamer/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pygamer/mpconfigboard.mk @@ -4,22 +4,20 @@ USB_PID = 0x803E USB_PRODUCT = "PyGamer" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMD51J19A +CHIP_FAMILY = samd51 + QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = GD25Q64C LONGINT_IMPL = MPZ -# No touch on SAMD51 yet -CIRCUITPY_TOUCHIO = 0 - +CIRCUITPY_AUDIOIO = 1 +CIRCUITPY_DISPLAYIO = 1 +CIRCUITPY_GAMEPAD = 1 CIRCUITPY_GAMEPADSHIFT = 1 - -CHIP_VARIANT = SAMD51J19A -CHIP_FAMILY = samd51 - CIRCUITPY_STAGE = 1 -CIRCUITPY_GAMEPAD = 1 -CIRCUITPY_DISPLAYIO = 1 -CIRCUITPY_AUDIOIO = 1 +# No touch on SAMD51 yet +CIRCUITPY_TOUCHIO = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pybadge diff --git a/ports/atmel-samd/boards/pyportal/mpconfigboard.mk b/ports/atmel-samd/boards/pyportal/mpconfigboard.mk index 21332eb3a..996b17b3b 100644 --- a/ports/atmel-samd/boards/pyportal/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyportal/mpconfigboard.mk @@ -4,14 +4,13 @@ USB_PID = 0x8036 USB_PRODUCT = "PyPortal" USB_MANUFACTURER = "Adafruit Industries LLC" -QSPI_FLASH_FILESYSTEM = 1 +CHIP_VARIANT = SAMD51J20A +CHIP_FAMILY = samd51 +QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, GD25Q64C" LONGINT_IMPL = MPZ # No touch on SAMD51 yet CIRCUITPY_TOUCHIO = 0 - -CHIP_VARIANT = SAMD51J20A -CHIP_FAMILY = samd51 diff --git a/ports/atmel-samd/boards/robohatmm1/mpconfigboard.mk b/ports/atmel-samd/boards/robohatmm1/mpconfigboard.mk index da7da2761..9523984b7 100644 --- a/ports/atmel-samd/boards/robohatmm1/mpconfigboard.mk +++ b/ports/atmel-samd/boards/robohatmm1/mpconfigboard.mk @@ -4,23 +4,25 @@ USB_PID = 0x4D43 USB_PRODUCT = "Robo HAT MM1" USB_MANUFACTURER = "Robotics Masters" +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + # Non-Flash Edition #INTERNAL_FLASH_FILESYSTEM = 1 #LONGINT_IMPL = NONE +#SUPEROPT_GC = 0 # SPI-Flash Edition SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ" LONGINT_IMPL = MPZ - -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 - # Make room for frozen Libraries CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 +CFLAGS_INLINE_LIMIT = 55 + # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice #FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_INA219 @@ -29,6 +31,3 @@ FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel #FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Crickit #FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Motor #FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_seesaw - -#Adding per @danh to reduce memory usage and get the latest changes in -CFLAGS_INLINE_LIMIT = 55 diff --git a/ports/atmel-samd/boards/sam32/mpconfigboard.mk b/ports/atmel-samd/boards/sam32/mpconfigboard.mk index d76696b39..ca1e11f01 100644 --- a/ports/atmel-samd/boards/sam32/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sam32/mpconfigboard.mk @@ -4,11 +4,11 @@ USB_PID = 0xEDBE USB_PRODUCT = "SAM32" USB_MANUFACTURER = "maholli" +CHIP_VARIANT = SAMD51J20A +CHIP_FAMILY = samd51 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ # No touch on SAMD51 yet CIRCUITPY_TOUCHIO = 0 - -CHIP_VARIANT = SAMD51J20A -CHIP_FAMILY = samd51 diff --git a/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk index 4da42c02d..9d0ef1c04 100755 --- a/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk @@ -4,16 +4,15 @@ USB_PID = 0x0017 USB_PRODUCT = "LUMIDrive Board" USB_MANUFACTURER = "SparkFun Electronics" -SPI_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = MPZ - CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 -CIRCUITPY_AUDIOIO = 0 -CIRCUITPY_AUDIOBUSIO = 0 - +SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "W25Q32FV" +LONGINT_IMPL = MPZ + +CIRCUITPY_AUDIOIO = 0 +CIRCUITPY_AUDIOBUSIO = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar diff --git a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk index 57400d6a7..ef6cf8924 100755 --- a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk @@ -4,17 +4,12 @@ USB_PID = 0x0015 USB_PRODUCT = "RedBoard Turbo Board" USB_MANUFACTURER = "SparkFun Electronics" -SPI_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = MPZ - CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 +SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "W25Q32FV" +LONGINT_IMPL = MPZ -# Tweak inlining depending on language. -ifeq ($(TRANSLATION), zh_Latn_pinyin) -CFLAGS_INLINE_LIMIT = 50 -RELEASE_NEEDS_CLEAN_BUILD = 1 -endif +CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk index 4afc74540..c9d0baf11 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk @@ -4,14 +4,11 @@ USB_PID = 0x8D23 USB_PRODUCT = "SparkFun SAMD21 Dev Breakout" USB_MANUFACTURER = "SparkFun" +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 - -ifeq ($(TRANSLATION), zh_Latn_pinyin) -CFLAGS_INLINE_LIMIT = 23 -RELEASE_NEEDS_CLEAN_BUILD = 1 -endif +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk index e1ba163f1..a6e216575 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk @@ -4,14 +4,11 @@ USB_PID = 0x8D22 USB_PRODUCT = "SparkFun SAMD21 Mini Breakout" USB_MANUFACTURER = "SparkFun" +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 - -ifeq ($(TRANSLATION), zh_Latn_pinyin) -CFLAGS_INLINE_LIMIT = 23 -RELEASE_NEEDS_CLEAN_BUILD = 1 -endif +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk index bfcada0d7..6d108e649 100644 --- a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk @@ -4,17 +4,16 @@ USB_PID = 0x8030 USB_PRODUCT = "Trellis M4 Express" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMD51G19A +CHIP_FAMILY = samd51 + QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, GD25Q64C" LONGINT_IMPL = MPZ +CIRCUITPY_PS2IO = 1 # No I2S on SAMD51G CIRCUITPY_AUDIOBUSIO = 0 # No touch on SAMD51 yet CIRCUITPY_TOUCHIO = 0 - -CHIP_VARIANT = SAMD51G19A -CHIP_FAMILY = samd51 - -CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk index 00f02911b..b4a00b654 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk @@ -4,14 +4,11 @@ USB_PID = 0x801F USB_PRODUCT = "Trinket M0" USB_MANUFACTURER = "Adafruit Industries LLC" +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 -CHIP_VARIANT = SAMD21E18A -CHIP_FAMILY = samd21 - -ifeq ($(TRANSLATION), zh_Latn_pinyin) -CFLAGS_INLINE_LIMIT = 23 -RELEASE_NEEDS_CLEAN_BUILD = 1 -endif +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk index c9c196da7..b9d36a741 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk @@ -4,10 +4,10 @@ USB_PID = 0x801F USB_PRODUCT="Trinket M0 Haxpress" USB_MANUFACTURER="Radomir Dopieralski" +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = W25Q32BV LONGINT_IMPL = MPZ - -CHIP_VARIANT = SAMD21E18A -CHIP_FAMILY = samd21 diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.mk b/ports/atmel-samd/boards/uchip/mpconfigboard.mk index b6710af6d..109492b76 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.mk +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.mk @@ -4,9 +4,9 @@ USB_PID = 0xED5F USB_PRODUCT = "uChip CircuitPython" USB_MANUFACTURER = "Itaca Innovation" +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 - -CHIP_VARIANT = SAMD21E18A -CHIP_FAMILY = samd21 diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk index cafd84b21..a27ca8874 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk @@ -4,14 +4,14 @@ USB_PID = 0x801F USB_PRODUCT = "uGame10" USB_MANUFACTURER = "Radomir Dopieralski" +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = S25FL216K LONGINT_IMPL = MPZ -CHIP_VARIANT = SAMD21E18A -CHIP_FAMILY = samd21 - CIRCUITPY_STAGE = 1 CIRCUITPY_MATH = 1 CIRCUITPY_AUDIOIO = 1 diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index ed9b9f461..47303a73a 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -32,13 +32,13 @@ # CIRCUITPY_FULL_BUILD = 0 ifndef CIRCUITPY_FULL_BUILD -ifeq ($(CIRCUITPY_SMALL_BUILD),1) -CIRCUITPY_FULL_BUILD = 0 -CFLAGS += -DCIRCUITPY_FULL_BUILD=0 -else -CIRCUITPY_FULL_BUILD = 1 -CFLAGS += -DCIRCUITPY_FULL_BUILD=1 -endif + ifeq ($(CIRCUITPY_SMALL_BUILD),1) + CIRCUITPY_FULL_BUILD = 0 + CFLAGS += -DCIRCUITPY_FULL_BUILD=0 + else + CIRCUITPY_FULL_BUILD = 1 + CFLAGS += -DCIRCUITPY_FULL_BUILD=1 + endif endif # All builtin modules are listed below, with default values (0 for off, 1 for on) diff --git a/py/py.mk b/py/py.mk index a69243b01..b4f1f00ef 100644 --- a/py/py.mk +++ b/py/py.mk @@ -107,9 +107,9 @@ endif # External modules written in C. ifneq ($(USER_C_MODULES),) -# pre-define USERMOD variables as expanded so that variables are immediate +# pre-define USERMOD variables as expanded so that variables are immediate # expanded as they're added to them -SRC_USERMOD := +SRC_USERMOD := CFLAGS_USERMOD := LDFLAGS_USERMOD := $(foreach module, $(wildcard $(USER_C_MODULES)/*/micropython.mk), \ @@ -343,10 +343,23 @@ $(PY_BUILD)/qstr.o: $(HEADER_BUILD)/qstrdefs.generated.h $(PY_BUILD)/nlr%.o: CFLAGS += -Os # optimising gc for speed; 5ms down to 4ms on pybv2 +ifndef SUPEROPT_GC + SUPEROPT_GC = 1 +endif + +ifeq ($(SUPEROPT_GC),1) $(PY_BUILD)/gc.o: CFLAGS += $(CSUPEROPT) +endif # optimising vm for speed, adds only a small amount to code size but makes a huge difference to speed (20% faster) -$(PY_BUILD)/vm.o: CFLAGS += $(CSUPEROPT) +ifndef SUPEROPT_VM + SUPEROPT_VM = 1 +endif + +ifeq ($(SUPEROPT_VM),1) +#$(PY_BUILD)/vm.o: CFLAGS += $(CSUPEROPT) +endif + # Optimizing vm.o for modern deeply pipelined CPUs with branch predictors # may require disabling tail jump optimization. This will make sure that # each opcode has its own dispatching jump which will improve branch -- cgit v1.2.3 From ba1b36a800393680c6681074c317532312930707 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 12 Jun 2019 13:09:09 -0400 Subject: Uncomment vm.c SUPEROPT (debugging typo); trim a few builds --- ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk | 2 ++ .../boards/circuitplayground_express_crickit/mpconfigboard.mk | 3 +++ py/py.mk | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'py') diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk index 6d2bece5d..3c43776f5 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk @@ -16,7 +16,9 @@ LONGINT_IMPL = MPZ CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 + SUPEROPT_GC = 0 +CFLAGS_INLINE_LIMIT = 55 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk index b80142b01..f456515f9 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk @@ -17,7 +17,10 @@ CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 + SUPEROPT_GC = 0 +CFLAGS_INLINE_LIMIT = 55 + # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice diff --git a/py/py.mk b/py/py.mk index b4f1f00ef..17cb79264 100644 --- a/py/py.mk +++ b/py/py.mk @@ -357,7 +357,7 @@ ifndef SUPEROPT_VM endif ifeq ($(SUPEROPT_VM),1) -#$(PY_BUILD)/vm.o: CFLAGS += $(CSUPEROPT) +$(PY_BUILD)/vm.o: CFLAGS += $(CSUPEROPT) endif # Optimizing vm.o for modern deeply pipelined CPUs with branch predictors -- cgit v1.2.3