summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2019-02-15 21:06:55 -0500
committerGitHub <noreply@github.com>2019-02-15 21:06:55 -0500
commit11ef64ef51a5f76d6a106e54008488974ab5e9ce (patch)
treec6abc3452daa7b9d3d0d78a1df1b5930063e23ee
parent35e3d99f62f908f6f371667b13120e20edb1142f (diff)
parent7b3f7605b8b36f5d0dbfbee60604ad266cac2645 (diff)
Merge pull request #1554 from dhalbert/refactor-build-settings
Major refactoring of mpconfig and makefiles; compile only what's used; easy on/off of modules
-rw-r--r--locale/ID.po75
-rw-r--r--locale/circuitpython.pot22
-rw-r--r--locale/de_DE.po43
-rw-r--r--locale/en_US.po22
-rw-r--r--locale/es.po155
-rw-r--r--locale/fil.po155
-rw-r--r--locale/fr.po159
-rw-r--r--locale/it_IT.po149
-rw-r--r--locale/pt_BR.po99
-rwxr-xr-xmain.c8
-rw-r--r--ports/atmel-samd/Makefile316
-rw-r--r--ports/atmel-samd/background.c4
-rw-r--r--ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk3
-rw-r--r--ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h2
-rw-r--r--ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk3
-rw-r--r--ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h5
-rw-r--r--ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk5
-rw-r--r--ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk5
-rw-r--r--ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.h3
-rw-r--r--ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk5
-rw-r--r--ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk3
-rw-r--r--ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/feather_m0_express/mpconfigboard.h2
-rw-r--r--ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk2
-rw-r--r--ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.h2
-rw-r--r--ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk3
-rw-r--r--ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h3
-rw-r--r--ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk5
-rwxr-xr-xports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk5
-rw-r--r--ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.h4
-rw-r--r--ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk3
-rw-r--r--ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.h2
-rw-r--r--ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk3
-rw-r--r--ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk5
-rw-r--r--ports/atmel-samd/boards/meowmeow/mpconfigboard.mk3
-rw-r--r--ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h2
-rw-r--r--ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk9
-rw-r--r--ports/atmel-samd/boards/metro_m4_express/mpconfigboard.h2
-rw-r--r--ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk5
-rw-r--r--ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk6
-rw-r--r--ports/atmel-samd/boards/pirkey_m0/mpconfigboard.h3
-rw-r--r--ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk13
-rw-r--r--ports/atmel-samd/boards/pyportal/mpconfigboard.h2
-rw-r--r--ports/atmel-samd/boards/pyportal/mpconfigboard.mk3
-rw-r--r--ports/atmel-samd/boards/sam32/mpconfigboard.mk5
-rw-r--r--ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk5
-rw-r--r--ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk3
-rw-r--r--ports/atmel-samd/common-hal/busio/I2C.c4
-rw-r--r--ports/atmel-samd/fatfs_port.c10
-rw-r--r--ports/atmel-samd/mpconfigport.h469
-rw-r--r--ports/atmel-samd/supervisor/port.c6
-rw-r--r--ports/esp8266/Makefile5
-rwxr-xr-xports/nrf/Makefile309
-rw-r--r--ports/nrf/bluetooth/ble_drv.c3
-rw-r--r--ports/nrf/bluetooth/ble_drv.h2
-rw-r--r--ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h3
-rw-r--r--ports/nrf/boards/feather_nrf52840_express/mpconfigboard.mk1
-rw-r--r--ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.h3
-rw-r--r--ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk1
-rw-r--r--ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.h3
-rw-r--r--ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk1
-rw-r--r--ports/nrf/boards/particle_argon/mpconfigboard.h3
-rw-r--r--ports/nrf/boards/particle_argon/mpconfigboard.mk1
-rw-r--r--ports/nrf/boards/particle_boron/mpconfigboard.h3
-rw-r--r--ports/nrf/boards/particle_boron/mpconfigboard.mk1
-rw-r--r--ports/nrf/boards/particle_xenon/mpconfigboard.h3
-rw-r--r--ports/nrf/boards/particle_xenon/mpconfigboard.mk1
-rw-r--r--ports/nrf/boards/pca10056/mpconfigboard.h1
-rw-r--r--ports/nrf/boards/pca10056/mpconfigboard.mk1
-rw-r--r--ports/nrf/boards/pca10059/mpconfigboard.h1
-rw-r--r--ports/nrf/boards/pca10059/mpconfigboard.mk1
-rw-r--r--ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.h2
-rw-r--r--ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk7
-rw-r--r--ports/nrf/common-hal/neopixel_write/__init__.c2
-rw-r--r--ports/nrf/common-hal/pulseio/PWMOut.c6
-rw-r--r--ports/nrf/common-hal/pulseio/PulseIn.c4
-rw-r--r--ports/nrf/mpconfigport.h211
-rw-r--r--ports/nrf/mpconfigport.mk17
-rw-r--r--ports/nrf/supervisor/internal_flash.c2
-rw-r--r--py/circuitpy_defns.mk346
-rw-r--r--py/circuitpy_mpconfig.h533
-rw-r--r--py/circuitpy_mpconfig.mk223
-rw-r--r--shared-bindings/bleio/Address.c4
-rw-r--r--shared-bindings/bleio/ScanEntry.c2
-rw-r--r--shared-bindings/bleio/UUID.c2
-rw-r--r--shared-bindings/network/__init__.c4
-rw-r--r--shared-bindings/nvm/__init__.c3
-rw-r--r--supervisor/port.h4
96 files changed, 1918 insertions, 1640 deletions
diff --git a/locale/ID.po b/locale/ID.po
index 198c5ed59..2c2712561 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-02-14 15:42+0100\n"
+"POT-Creation-Date: 2019-02-15 19:19-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -155,7 +155,7 @@ msgstr "kompilasi script tidak didukung"
msgid " output:\n"
msgstr "output:\n"
-#: main.c:166 main.c:248
+#: main.c:166 main.c:250
msgid ""
"Auto-reload is on. Simply save files over USB to run them or enter REPL to "
"disable.\n"
@@ -167,7 +167,7 @@ msgstr ""
msgid "Running in safe mode! Auto-reload is off.\n"
msgstr "Berjalan di mode aman(safe mode)! Auto-reload tidak aktif.\n"
-#: main.c:170 main.c:250
+#: main.c:170 main.c:252
msgid "Auto-reload is off.\n"
msgstr "Auto-reload tidak aktif.\n"
@@ -180,19 +180,19 @@ msgstr ""
msgid "WARNING: Your code filename has two extensions\n"
msgstr "PERINGATAN: Nama file kode anda mempunyai dua ekstensi\n"
-#: main.c:221
+#: main.c:223
msgid ""
"\n"
"Code done running. Waiting for reload.\n"
msgstr ""
-#: main.c:255
+#: main.c:257
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr ""
"Tekan tombol apa saja untuk masuk ke dalam REPL. Gunakan CTRL+D untuk reset "
"(Reload)"
-#: main.c:420
+#: main.c:422
msgid "soft reboot\n"
msgstr "memulai ulang software(soft reboot)\n"
@@ -322,11 +322,7 @@ msgstr "Semua channel event sedang digunakan"
msgid "Sample rate too high. It must be less than %d"
msgstr "Nilai sampel terlalu tinggi. Nilai harus kurang dari %d"
-#: ports/atmel-samd/common-hal/busio/I2C.c:71
-msgid "Not enough pins available"
-msgstr "Pin yang tersedia tidak cukup"
-
-#: ports/atmel-samd/common-hal/busio/I2C.c:78
+#: ports/atmel-samd/common-hal/busio/I2C.c:74
#: ports/atmel-samd/common-hal/busio/SPI.c:176
#: ports/atmel-samd/common-hal/busio/UART.c:120
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45
@@ -334,11 +330,11 @@ msgstr "Pin yang tersedia tidak cukup"
msgid "Invalid pins"
msgstr "Pin-pin tidak valid"
-#: ports/atmel-samd/common-hal/busio/I2C.c:101
+#: ports/atmel-samd/common-hal/busio/I2C.c:97
msgid "SDA or SCL needs a pull up"
msgstr "SDA atau SCL membutuhkan pull up"
-#: ports/atmel-samd/common-hal/busio/I2C.c:121
+#: ports/atmel-samd/common-hal/busio/I2C.c:117
msgid "Unsupported baudrate"
msgstr "Baudrate tidak didukung"
@@ -2847,24 +2843,19 @@ msgid ""
"exit safe mode.\n"
msgstr ""
-#~ msgid "busio.UART not available"
-#~ msgstr "busio.UART tidak tersedia"
-
-#~ msgid ""
-#~ "Please file an issue here with the contents of your CIRCUITPY drive:\n"
-#~ msgstr ""
-#~ "Silahkan taruh masalah disini dengan isi dari CIRCUITPY drive: anda \n"
-
-#~ msgid "Looks like our core CircuitPython code crashed hard. Whoops!\n"
-#~ msgstr ""
-#~ "Sepertinya inti kode CircuitPython kita crash dengan sangat keras. Ups!\n"
+#, fuzzy
+#~ msgid "buffer_size must be >= 1"
+#~ msgstr "buffers harus mempunyai panjang yang sama"
#, fuzzy
-#~ msgid "unpack requires a buffer of %d bytes"
-#~ msgstr "Gagal untuk megalokasikan buffer RX dari %d byte"
+#~ msgid "unicode_characters must be a string"
+#~ msgstr "keyword harus berupa string"
-#~ msgid "Invalid UUID parameter"
-#~ msgstr "Parameter UUID tidak valid"
+#~ msgid "All PWM peripherals are in use"
+#~ msgstr "Semua perangkat PWM sedang digunakan"
+
+#~ msgid "Invalid UUID string length"
+#~ msgstr "Panjang string UUID tidak valid"
#~ msgid ""
#~ "enough power for the whole circuit and press reset (after ejecting "
@@ -2873,16 +2864,24 @@ msgstr ""
#~ "tegangan cukup untuk semua sirkuit dan tekan reset (setelah mencabut "
#~ "CIRCUITPY).\n"
-#~ msgid "Invalid UUID string length"
-#~ msgstr "Panjang string UUID tidak valid"
-
-#~ msgid "All PWM peripherals are in use"
-#~ msgstr "Semua perangkat PWM sedang digunakan"
+#~ msgid "Invalid UUID parameter"
+#~ msgstr "Parameter UUID tidak valid"
#, fuzzy
-#~ msgid "unicode_characters must be a string"
-#~ msgstr "keyword harus berupa string"
+#~ msgid "unpack requires a buffer of %d bytes"
+#~ msgstr "Gagal untuk megalokasikan buffer RX dari %d byte"
-#, fuzzy
-#~ msgid "buffer_size must be >= 1"
-#~ msgstr "buffers harus mempunyai panjang yang sama"
+#~ msgid "Looks like our core CircuitPython code crashed hard. Whoops!\n"
+#~ msgstr ""
+#~ "Sepertinya inti kode CircuitPython kita crash dengan sangat keras. Ups!\n"
+
+#~ msgid ""
+#~ "Please file an issue here with the contents of your CIRCUITPY drive:\n"
+#~ msgstr ""
+#~ "Silahkan taruh masalah disini dengan isi dari CIRCUITPY drive: anda \n"
+
+#~ msgid "busio.UART not available"
+#~ msgstr "busio.UART tidak tersedia"
+
+#~ msgid "Not enough pins available"
+#~ msgstr "Pin yang tersedia tidak cukup"
diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot
index 1d6e30ddc..b1788fc9e 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-02-14 15:42+0100\n"
+"POT-Creation-Date: 2019-02-15 19:19-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -155,7 +155,7 @@ msgstr ""
msgid " output:\n"
msgstr ""
-#: main.c:166 main.c:248
+#: main.c:166 main.c:250
msgid ""
"Auto-reload is on. Simply save files over USB to run them or enter REPL to "
"disable.\n"
@@ -165,7 +165,7 @@ msgstr ""
msgid "Running in safe mode! Auto-reload is off.\n"
msgstr ""
-#: main.c:170 main.c:250
+#: main.c:170 main.c:252
msgid "Auto-reload is off.\n"
msgstr ""
@@ -177,17 +177,17 @@ msgstr ""
msgid "WARNING: Your code filename has two extensions\n"
msgstr ""
-#: main.c:221
+#: main.c:223
msgid ""
"\n"
"Code done running. Waiting for reload.\n"
msgstr ""
-#: main.c:255
+#: main.c:257
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr ""
-#: main.c:420
+#: main.c:422
msgid "soft reboot\n"
msgstr ""
@@ -315,11 +315,7 @@ msgstr ""
msgid "Sample rate too high. It must be less than %d"
msgstr ""
-#: ports/atmel-samd/common-hal/busio/I2C.c:71
-msgid "Not enough pins available"
-msgstr ""
-
-#: ports/atmel-samd/common-hal/busio/I2C.c:78
+#: ports/atmel-samd/common-hal/busio/I2C.c:74
#: ports/atmel-samd/common-hal/busio/SPI.c:176
#: ports/atmel-samd/common-hal/busio/UART.c:120
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45
@@ -327,11 +323,11 @@ msgstr ""
msgid "Invalid pins"
msgstr ""
-#: ports/atmel-samd/common-hal/busio/I2C.c:101
+#: ports/atmel-samd/common-hal/busio/I2C.c:97
msgid "SDA or SCL needs a pull up"
msgstr ""
-#: ports/atmel-samd/common-hal/busio/I2C.c:121
+#: ports/atmel-samd/common-hal/busio/I2C.c:117
msgid "Unsupported baudrate"
msgstr ""
diff --git a/locale/de_DE.po b/locale/de_DE.po
index e0e38b0e7..a3cd82c0a 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-02-14 15:42+0100\n"
+"POT-Creation-Date: 2019-02-15 19:19-0500\n"
"PO-Revision-Date: 2018-07-27 11:55-0700\n"
"Last-Translator: Sebastian Plamauer\n"
"Language-Team: \n"
@@ -155,7 +155,7 @@ msgstr "kompilieren von Skripten ist nicht unterstützt"
msgid " output:\n"
msgstr " Ausgabe:\n"
-#: main.c:166 main.c:248
+#: main.c:166 main.c:250
msgid ""
"Auto-reload is on. Simply save files over USB to run them or enter REPL to "
"disable.\n"
@@ -167,7 +167,7 @@ msgstr ""
msgid "Running in safe mode! Auto-reload is off.\n"
msgstr "Sicherheitsmodus aktiv! Automatisches Neuladen ist deaktiviert.\n"
-#: main.c:170 main.c:250
+#: main.c:170 main.c:252
msgid "Auto-reload is off.\n"
msgstr "Automatisches Neuladen ist deaktiviert.\n"
@@ -180,19 +180,19 @@ msgid "WARNING: Your code filename has two extensions\n"
msgstr ""
"WARNUNG: Der Dateiname deines Programms hat zwei Dateityperweiterungen\n"
-#: main.c:221
+#: main.c:223
msgid ""
"\n"
"Code done running. Waiting for reload.\n"
msgstr ""
-#: main.c:255
+#: main.c:257
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr ""
"Drücke eine Taste um dich mit der REPL zu verbinden. Drücke Strg-D zum neu "
"laden"
-#: main.c:420
+#: main.c:422
msgid "soft reboot\n"
msgstr "soft reboot\n"
@@ -320,11 +320,7 @@ msgstr "Alle event Kanäle werden benutzt"
msgid "Sample rate too high. It must be less than %d"
msgstr "Abtastrate zu hoch. Wert muss unter %d liegen"
-#: ports/atmel-samd/common-hal/busio/I2C.c:71
-msgid "Not enough pins available"
-msgstr "Nicht genug Pins vorhanden"
-
-#: ports/atmel-samd/common-hal/busio/I2C.c:78
+#: ports/atmel-samd/common-hal/busio/I2C.c:74
#: ports/atmel-samd/common-hal/busio/SPI.c:176
#: ports/atmel-samd/common-hal/busio/UART.c:120
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45
@@ -332,11 +328,11 @@ msgstr "Nicht genug Pins vorhanden"
msgid "Invalid pins"
msgstr "Ungültige Pins"
-#: ports/atmel-samd/common-hal/busio/I2C.c:101
+#: ports/atmel-samd/common-hal/busio/I2C.c:97
msgid "SDA or SCL needs a pull up"
msgstr "SDA oder SCL brauchen pull up"
-#: ports/atmel-samd/common-hal/busio/I2C.c:121
+#: ports/atmel-samd/common-hal/busio/I2C.c:117
msgid "Unsupported baudrate"
msgstr "Baudrate wird nicht unterstützt"
@@ -2844,19 +2840,22 @@ msgstr ""
"Die Reset-Taste wurde beim Booten von CircuitPython gedrückt. Drücke sie "
"erneut um den abgesicherten Modus zu verlassen. \n"
-#~ msgid "busio.UART not available"
-#~ msgstr "busio.UART nicht verfügbar"
+#~ msgid "buffer_size must be >= 1"
+#~ msgstr "Puffergröße muss >= 1 sein"
-#~ msgid "All PWM peripherals are in use"
-#~ msgstr "Alle PWM-Peripheriegeräte werden verwendet"
+#, fuzzy
+#~ msgid "Group must have %q at least 1"
+#~ msgstr "Der Puffer muss eine Mindestenslänge von 1 haben"
#, fuzzy
#~ msgid "unicode_characters must be a string"
#~ msgstr "name muss ein String sein"
-#, fuzzy
-#~ msgid "Group must have %q at least 1"
-#~ msgstr "Der Puffer muss eine Mindestenslänge von 1 haben"
+#~ msgid "All PWM peripherals are in use"
+#~ msgstr "Alle PWM-Peripheriegeräte werden verwendet"
-#~ msgid "buffer_size must be >= 1"
-#~ msgstr "Puffergröße muss >= 1 sein"
+#~ msgid "busio.UART not available"
+#~ msgstr "busio.UART nicht verfügbar"
+
+#~ msgid "Not enough pins available"
+#~ msgstr "Nicht genug Pins vorhanden"
diff --git a/locale/en_US.po b/locale/en_US.po
index 64cf566a2..11d9d062b 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-02-14 15:42+0100\n"
+"POT-Creation-Date: 2019-02-15 19:19-0500\n"
"PO-Revision-Date: 2018-07-27 11:55-0700\n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -155,7 +155,7 @@ msgstr ""
msgid " output:\n"
msgstr ""
-#: main.c:166 main.c:248
+#: main.c:166 main.c:250
msgid ""
"Auto-reload is on. Simply save files over USB to run them or enter REPL to "
"disable.\n"
@@ -165,7 +165,7 @@ msgstr ""
msgid "Running in safe mode! Auto-reload is off.\n"
msgstr ""
-#: main.c:170 main.c:250
+#: main.c:170 main.c:252
msgid "Auto-reload is off.\n"
msgstr ""
@@ -177,17 +177,17 @@ msgstr ""
msgid "WARNING: Your code filename has two extensions\n"
msgstr ""
-#: main.c:221
+#: main.c:223
msgid ""
"\n"
"Code done running. Waiting for reload.\n"
msgstr ""
-#: main.c:255
+#: main.c:257
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr ""
-#: main.c:420
+#: main.c:422
msgid "soft reboot\n"
msgstr ""
@@ -315,11 +315,7 @@ msgstr ""
msgid "Sample rate too high. It must be less than %d"
msgstr ""
-#: ports/atmel-samd/common-hal/busio/I2C.c:71
-msgid "Not enough pins available"
-msgstr ""
-
-#: ports/atmel-samd/common-hal/busio/I2C.c:78
+#: ports/atmel-samd/common-hal/busio/I2C.c:74
#: ports/atmel-samd/common-hal/busio/SPI.c:176
#: ports/atmel-samd/common-hal/busio/UART.c:120
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45
@@ -327,11 +323,11 @@ msgstr ""
msgid "Invalid pins"
msgstr ""
-#: ports/atmel-samd/common-hal/busio/I2C.c:101
+#: ports/atmel-samd/common-hal/busio/I2C.c:97
msgid "SDA or SCL needs a pull up"
msgstr ""
-#: ports/atmel-samd/common-hal/busio/I2C.c:121
+#: ports/atmel-samd/common-hal/busio/I2C.c:117
msgid "Unsupported baudrate"
msgstr ""
diff --git a/locale/es.po b/locale/es.po
index 721effe7f..7693b8c8d 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-02-14 15:42+0100\n"
+"POT-Creation-Date: 2019-02-15 19:19-0500\n"
"PO-Revision-Date: 2018-08-24 22:56-0500\n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -156,7 +156,7 @@ msgstr "script de compilación no soportado"
msgid " output:\n"
msgstr " salida:\n"
-#: main.c:166 main.c:248
+#: main.c:166 main.c:250
msgid ""
"Auto-reload is on. Simply save files over USB to run them or enter REPL to "
"disable.\n"
@@ -168,7 +168,7 @@ msgstr ""
msgid "Running in safe mode! Auto-reload is off.\n"
msgstr "Ejecutando en modo seguro! La auto-recarga esta deshabilitada.\n"
-#: main.c:170 main.c:250
+#: main.c:170 main.c:252
msgid "Auto-reload is off.\n"
msgstr "Auto-recarga deshabilitada.\n"
@@ -180,18 +180,18 @@ msgstr "Ejecutando en modo seguro! No se esta ejecutando el código guardado.\n"
msgid "WARNING: Your code filename has two extensions\n"
msgstr "ADVERTENCIA: El nombre de archivo de tu código tiene dos extensiones\n"
-#: main.c:221
+#: main.c:223
msgid ""
"\n"
"Code done running. Waiting for reload.\n"
msgstr ""
-#: main.c:255
+#: main.c:257
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr ""
"Presiona cualquier tecla para entrar al REPL. Usa CTRL-D para recargar."
-#: main.c:420
+#: main.c:422
msgid "soft reboot\n"
msgstr "reinicio suave\n"
@@ -321,11 +321,7 @@ msgstr "Todos los canales de eventos en uso"
msgid "Sample rate too high. It must be less than %d"
msgstr "Frecuencia de muestreo demasiado alta. Debe ser menor a %d"
-#: ports/atmel-samd/common-hal/busio/I2C.c:71
-msgid "Not enough pins available"
-msgstr "No hay suficientes pines disponibles"
-
-#: ports/atmel-samd/common-hal/busio/I2C.c:78
+#: ports/atmel-samd/common-hal/busio/I2C.c:74
#: ports/atmel-samd/common-hal/busio/SPI.c:176
#: ports/atmel-samd/common-hal/busio/UART.c:120
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45
@@ -333,11 +329,11 @@ msgstr "No hay suficientes pines disponibles"
msgid "Invalid pins"
msgstr "pines inválidos"
-#: ports/atmel-samd/common-hal/busio/I2C.c:101
+#: ports/atmel-samd/common-hal/busio/I2C.c:97
msgid "SDA or SCL needs a pull up"
msgstr "SDA o SCL necesitan una pull up"
-#: ports/atmel-samd/common-hal/busio/I2C.c:121
+#: ports/atmel-samd/common-hal/busio/I2C.c:117
msgid "Unsupported baudrate"
msgstr "Baudrate no soportado"
@@ -2885,99 +2881,102 @@ msgstr ""
"El botón reset fue presionado mientras arrancaba CircuitPython. Presiona "
"otra vez para salir del modo seguro.\n"
-#~ msgid "busio.UART not available"
-#~ msgstr "busio.UART no disponible"
-
-#~ msgid "Can not apply advertisement data. status: 0x%02x"
-#~ msgstr "No se puede aplicar los datos de anuncio. status: 0x%02x"
-
#, fuzzy
-#~ msgid ""
-#~ "Please file an issue here with the contents of your CIRCUITPY drive:\n"
-#~ msgstr ""
-#~ "Por favor registra un issue en la siguiente URL con el contenidos de tu "
-#~ "unidad de almacenamiento CIRCUITPY:\n"
+#~ msgid "buffer_size must be >= 1"
+#~ msgstr "los buffers deben de tener la misma longitud"
-#~ msgid "Cannot set PPCP parameters."
-#~ msgstr "No se pueden establecer los parámetros PPCP."
+#, fuzzy
+#~ msgid "Group must have %q at least 1"
+#~ msgstr "Group debe tener size de minimo 1"
-#~ msgid "Can not apply device name in the stack."
-#~ msgstr "No se puede aplicar el nombre del dispositivo en el stack."
+#~ msgid "Baud rate too high for this SPI peripheral"
+#~ msgstr "Baud rate demasiado alto para este periférico SPI"
-#~ msgid "Cannot apply GAP parameters."
-#~ msgstr "No se pueden aplicar los parámetros GAP."
+#~ msgid "Invalid UUID parameter"
+#~ msgstr "Parámetro UUID inválido"
-#~ msgid "Wrong number of bytes provided"
-#~ msgstr "Numero erroneo de bytes dados"
+#~ msgid "row buffer must be a bytearray or array of type 'b' or 'B'"
+#~ msgstr "row buffer deberia ser un bytearray o array de tipo 'b' o 'B'"
-#~ msgid "Can not encode UUID, to check length."
-#~ msgstr "No se puede codificar el UUID, para revisar la longitud."
+#~ msgid "row data must be a buffer"
+#~ msgstr "row data debe ser un buffer"
#, fuzzy
-#~ msgid "unpack requires a buffer of %d bytes"
-#~ msgstr "Falló la asignación del buffer RX de %d bytes"
+#~ msgid "unicode_characters must be a string"
+#~ msgstr "palabras clave deben ser strings"
-#~ msgid ""
-#~ "enough power for the whole circuit and press reset (after ejecting "
-#~ "CIRCUITPY).\n"
+#~ msgid "index must be int"
+#~ msgstr "indice debe ser int"
+
+#~ msgid "Can not query for the device address."
+#~ msgstr "No se puede consultar la dirección del dispositivo."
+
+#~ msgid "All PWM peripherals are in use"
+#~ msgstr "Todos los periféricos PWM en uso"
+
+#~ msgid "Looks like our core CircuitPython code crashed hard. Whoops!\n"
#~ msgstr ""
-#~ "suficiente poder para todo el circuito y presiona reset (después de "
-#~ "expulsar CIRCUITPY).\n"
+#~ "Parece que nuestro código CircuitPython dejó de funcionar. Whoops!\n"
-#~ msgid "displayio is a work in progress"
-#~ msgstr "displayio todavia esta en desarrollo"
+#~ msgid "Group empty"
+#~ msgstr "Group vacío"
-#~ msgid "Can not add Service."
-#~ msgstr "No se puede agregar el Servicio."
+#~ msgid "Wrong address length"
+#~ msgstr "Longitud de address erronea"
-#~ msgid "Invalid UUID string length"
-#~ msgstr "Longitud de string UUID inválida"
+#~ msgid "Can encode UUID into the advertisement packet."
+#~ msgstr "Se puede codificar el UUID en el paquete de anuncio."
#~ msgid "Invalid Service type"
#~ msgstr "Tipo de Servicio inválido"
-#~ msgid "Can encode UUID into the advertisement packet."
-#~ msgstr "Se puede codificar el UUID en el paquete de anuncio."
+#~ msgid "Invalid UUID string length"
+#~ msgstr "Longitud de string UUID inválida"
-#~ msgid "Wrong address length"
-#~ msgstr "Longitud de address erronea"
+#~ msgid "Can not add Service."
+#~ msgstr "No se puede agregar el Servicio."
-#~ msgid "Group empty"
-#~ msgstr "Group vacío"
+#~ msgid "displayio is a work in progress"
+#~ msgstr "displayio todavia esta en desarrollo"
-#~ msgid "Looks like our core CircuitPython code crashed hard. Whoops!\n"
+#~ msgid ""
+#~ "enough power for the whole circuit and press reset (after ejecting "
+#~ "CIRCUITPY).\n"
#~ msgstr ""
-#~ "Parece que nuestro código CircuitPython dejó de funcionar. Whoops!\n"
+#~ "suficiente poder para todo el circuito y presiona reset (después de "
+#~ "expulsar CIRCUITPY).\n"
-#~ msgid "All PWM peripherals are in use"
-#~ msgstr "Todos los periféricos PWM en uso"
+#, fuzzy
+#~ msgid "unpack requires a buffer of %d bytes"
+#~ msgstr "Falló la asignación del buffer RX de %d bytes"
-#~ msgid "Can not query for the device address."
-#~ msgstr "No se puede consultar la dirección del dispositivo."
+#~ msgid "Can not encode UUID, to check length."
+#~ msgstr "No se puede codificar el UUID, para revisar la longitud."
-#~ msgid "index must be int"
-#~ msgstr "indice debe ser int"
+#~ msgid "Wrong number of bytes provided"
+#~ msgstr "Numero erroneo de bytes dados"
-#, fuzzy
-#~ msgid "unicode_characters must be a string"
-#~ msgstr "palabras clave deben ser strings"
+#~ msgid "Cannot apply GAP parameters."
+#~ msgstr "No se pueden aplicar los parámetros GAP."
-#~ msgid "row data must be a buffer"
-#~ msgstr "row data debe ser un buffer"
+#~ msgid "Can not apply device name in the stack."
+#~ msgstr "No se puede aplicar el nombre del dispositivo en el stack."
-#~ msgid "row buffer must be a bytearray or array of type 'b' or 'B'"
-#~ msgstr "row buffer deberia ser un bytearray o array de tipo 'b' o 'B'"
+#~ msgid "Cannot set PPCP parameters."
+#~ msgstr "No se pueden establecer los parámetros PPCP."
-#~ msgid "Invalid UUID parameter"
-#~ msgstr "Parámetro UUID inválido"
+#, fuzzy
+#~ msgid ""
+#~ "Please file an issue here with the contents of your CIRCUITPY drive:\n"
+#~ msgstr ""
+#~ "Por favor registra un issue en la siguiente URL con el contenidos de tu "
+#~ "unidad de almacenamiento CIRCUITPY:\n"
-#~ msgid "Baud rate too high for this SPI peripheral"
-#~ msgstr "Baud rate demasiado alto para este periférico SPI"
+#~ msgid "Can not apply advertisement data. status: 0x%02x"
+#~ msgstr "No se puede aplicar los datos de anuncio. status: 0x%02x"
-#, fuzzy
-#~ msgid "Group must have %q at least 1"
-#~ msgstr "Group debe tener size de minimo 1"
+#~ msgid "busio.UART not available"
+#~ msgstr "busio.UART no disponible"
-#, fuzzy
-#~ msgid "buffer_size must be >= 1"
-#~ msgstr "los buffers deben de tener la misma longitud"
+#~ msgid "Not enough pins available"
+#~ msgstr "No hay suficientes pines disponibles"
diff --git a/locale/fil.po b/locale/fil.po
index 670b35ad3..60c8ea076 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-02-14 15:42+0100\n"
+"POT-Creation-Date: 2019-02-15 19:19-0500\n"
"PO-Revision-Date: 2018-12-20 22:15-0800\n"
"Last-Translator: Timothy <me@timothygarcia.ca>\n"
"Language-Team: fil\n"
@@ -155,7 +155,7 @@ msgstr "script kompilasyon hindi supportado"
msgid " output:\n"
msgstr " output:\n"
-#: main.c:166 main.c:248
+#: main.c:166 main.c:250
msgid ""
"Auto-reload is on. Simply save files over USB to run them or enter REPL to "
"disable.\n"
@@ -167,7 +167,7 @@ msgstr ""
msgid "Running in safe mode! Auto-reload is off.\n"
msgstr "Tumatakbo sa safe mode! Awtomatikong pag re-reload ay OFF.\n"
-#: main.c:170 main.c:250
+#: main.c:170 main.c:252
msgid "Auto-reload is off.\n"
msgstr "Awtomatikong pag re-reload ay OFF.\n"
@@ -179,19 +179,19 @@ msgstr "Tumatakbo sa safe mode! Hindi tumatakbo ang nai-save na code.\n"
msgid "WARNING: Your code filename has two extensions\n"
msgstr "BABALA: Ang pangalan ng file ay may dalawang extension\n"
-#: main.c:221
+#: main.c:223
msgid ""
"\n"
"Code done running. Waiting for reload.\n"
msgstr ""
-#: main.c:255
+#: main.c:257
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr ""
"Pindutin ang anumang key upang pumasok sa REPL. Gamitin ang CTRL-D upang i-"
"reload."
-#: main.c:420
+#: main.c:422
msgid "soft reboot\n"
msgstr "malambot na reboot\n"
@@ -319,11 +319,7 @@ msgstr "Lahat ng event channels ginagamit"
msgid "Sample rate too high. It must be less than %d"
msgstr "Sample rate ay masyadong mataas. Ito ay dapat hindi hiigit sa %d"
-#: ports/atmel-samd/common-hal/busio/I2C.c:71
-msgid "Not enough pins available"
-msgstr "Hindi sapat ang magagamit na pins"
-
-#: ports/atmel-samd/common-hal/busio/I2C.c:78
+#: ports/atmel-samd/common-hal/busio/I2C.c:74
#: ports/atmel-samd/common-hal/busio/SPI.c:176
#: ports/atmel-samd/common-hal/busio/UART.c:120
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45
@@ -331,11 +327,11 @@ msgstr "Hindi sapat ang magagamit na pins"
msgid "Invalid pins"
msgstr "Mali ang pins"
-#: ports/atmel-samd/common-hal/busio/I2C.c:101
+#: ports/atmel-samd/common-hal/busio/I2C.c:97
msgid "SDA or SCL needs a pull up"
msgstr "Kailangan ng pull up resistors ang SDA o SCL"
-#: ports/atmel-samd/common-hal/busio/I2C.c:121
+#: ports/atmel-samd/common-hal/busio/I2C.c:117
msgid "Unsupported baudrate"
msgstr "Hindi supportadong baudrate"
@@ -2891,99 +2887,102 @@ msgstr ""
"Ang reset button ay pinindot habang nag boot ang CircuitPython. Pindutin "
"ulit para lumabas sa safe mode.\n"
-#~ msgid "busio.UART not available"
-#~ msgstr "busio.UART hindi available"
+#, fuzzy
+#~ msgid "buffer_size must be >= 1"
+#~ msgstr "aarehas na haba dapat ang buffer slices"
-#~ msgid "Can not apply advertisement data. status: 0x%02x"
-#~ msgstr "Hindi ma i-apply ang advertisement data. status: 0x%02x"
+#, fuzzy
+#~ msgid "Group must have %q at least 1"
+#~ msgstr "Group dapat ay hindi baba sa 1 na haba"
-#~ msgid ""
-#~ "Please file an issue here with the contents of your CIRCUITPY drive:\n"
-#~ msgstr ""
-#~ "Mag-file ng isang isyu dito gamit ang mga nilalaman ng iyong CIRCUITPY "
-#~ "drive:\n"
+#, fuzzy
+#~ msgid "palette must be displayio.Palette"
+#~ msgstr "ang palette ay dapat 32 bytes ang haba"
-#~ msgid "Cannot set PPCP parameters."
-#~ msgstr "Hindi ma-set ang PPCP parameters."
+#~ msgid "Invalid UUID parameter"
+#~ msgstr "Mali ang UUID parameter"
-#~ msgid "Can not apply device name in the stack."
-#~ msgstr "Hindi maaaring ma-aplay ang device name sa stack."
+#~ msgid "row buffer must be a bytearray or array of type 'b' or 'B'"
+#~ msgstr "ang row buffer ay dapat bytearray o array na type ‘b’ or ‘B’"
-#~ msgid "Cannot apply GAP parameters."
-#~ msgstr "Hindi ma-apply ang GAP parameters."
+#~ msgid "row data must be a buffer"
+#~ msgstr "row data ay dapat na buffer"
-#~ msgid "Wrong number of bytes provided"
-#~ msgstr "Mali ang bilang ng bytes"
+#, fuzzy
+#~ msgid "unicode_characters must be a string"
+#~ msgstr "ang keywords dapat strings"
-#~ msgid "Can not encode UUID, to check length."
-#~ msgstr "Hindi ma-encode UUID, para suriin ang haba."
+#~ msgid "index must be int"
+#~ msgstr "index ay dapat int"
-#, fuzzy
-#~ msgid "unpack requires a buffer of %d bytes"
-#~ msgstr "Nabigong ilaan ang RX buffer ng %d bytes"
+#~ msgid "Can not query for the device address."
+#~ msgstr "Hindi maaaring mag-query para sa address ng device."
-#~ msgid ""
-#~ "enough power for the whole circuit and press reset (after ejecting "
-#~ "CIRCUITPY).\n"
+#~ msgid "All PWM peripherals are in use"
+#~ msgstr "Lahat ng PWM peripherals ay ginagamit"
+
+#~ msgid "Looks like our core CircuitPython code crashed hard. Whoops!\n"
#~ msgstr ""
-#~ "ay nagbibigay ng sapat na power para sa buong circuit at i-press ang "
-#~ "reset (pagkatapos i-eject ang CIRCUITPY).\n"
+#~ "Mukhang ang core CircuitPython code ay nag-crash ng malakas. Aray!\n"
-#~ msgid "displayio is a work in progress"
-#~ msgstr "displayio ay nasa gitna ng konstruksiyon"
+#~ msgid "Group empty"
+#~ msgstr "Walang laman ang group"
-#~ msgid "Can not add Service."
-#~ msgstr "Hindi maidaragdag ang serbisyo."
+#~ msgid "Wrong address length"
+#~ msgstr "Mali ang address length"
-#~ msgid "Invalid UUID string length"
-#~ msgstr "Mali ang UUID string length"
+#~ msgid "Can encode UUID into the advertisement packet."
+#~ msgstr "Maaring i-encode ang UUID sa advertisement packet."
#~ msgid "Invalid Service type"
#~ msgstr "Mali ang tipo ng serbisyo"
-#~ msgid "Can encode UUID into the advertisement packet."
-#~ msgstr "Maaring i-encode ang UUID sa advertisement packet."
+#~ msgid "Invalid UUID string length"
+#~ msgstr "Mali ang UUID string length"
-#~ msgid "Wrong address length"
-#~ msgstr "Mali ang address length"
+#~ msgid "Can not add Service."
+#~ msgstr "Hindi maidaragdag ang serbisyo."
-#~ msgid "Group empty"
-#~ msgstr "Walang laman ang group"
+#~ msgid "displayio is a work in progress"
+#~ msgstr "displayio ay nasa gitna ng konstruksiyon"
-#~ msgid "Looks like our core CircuitPython code crashed hard. Whoops!\n"
+#~ msgid ""
+#~ "enough power for the whole circuit and press reset (after ejecting "
+#~ "CIRCUITPY).\n"
#~ msgstr ""
-#~ "Mukhang ang core CircuitPython code ay nag-crash ng malakas. Aray!\n"
+#~ "ay nagbibigay ng sapat na power para sa buong circuit at i-press ang "
+#~ "reset (pagkatapos i-eject ang CIRCUITPY).\n"
-#~ msgid "All PWM peripherals are in use"
-#~ msgstr "Lahat ng PWM peripherals ay ginagamit"
+#, fuzzy
+#~ msgid "unpack requires a buffer of %d bytes"
+#~ msgstr "Nabigong ilaan ang RX buffer ng %d bytes"
-#~ msgid "Can not query for the device address."
-#~ msgstr "Hindi maaaring mag-query para sa address ng device."
+#~ msgid "Can not encode UUID, to check length."
+#~ msgstr "Hindi ma-encode UUID, para suriin ang haba."
-#~ msgid "index must be int"
-#~ msgstr "index ay dapat int"
+#~ msgid "Wrong number of bytes provided"
+#~ msgstr "Mali ang bilang ng bytes"
-#, fuzzy
-#~ msgid "unicode_characters must be a string"
-#~ msgstr "ang keywords dapat strings"
+#~ msgid "Cannot apply GAP parameters."
+#~ msgstr "Hindi ma-apply ang GAP parameters."
-#~ msgid "row data must be a buffer"
-#~ msgstr "row data ay dapat na buffer"
+#~ msgid "Can not apply device name in the stack."
+#~ msgstr "Hindi maaaring ma-aplay ang device name sa stack."
-#~ msgid "row buffer must be a bytearray or array of type 'b' or 'B'"
-#~ msgstr "ang row buffer ay dapat bytearray o array na type ‘b’ or ‘B’"
+#~ msgid "Cannot set PPCP parameters."
+#~ msgstr "Hindi ma-set ang PPCP parameters."
-#~ msgid "Invalid UUID parameter"
-#~ msgstr "Mali ang UUID parameter"
+#~ msgid ""
+#~ "Please file an issue here with the contents of your CIRCUITPY drive:\n"
+#~ msgstr ""
+#~ "Mag-file ng isang isyu dito gamit ang mga nilalaman ng iyong CIRCUITPY "
+#~ "drive:\n"
-#, fuzzy
-#~ msgid "palette must be displayio.Palette"
-#~ msgstr "ang palette ay dapat 32 bytes ang haba"
+#~ msgid "Can not apply advertisement data. status: 0x%02x"
+#~ msgstr "Hindi ma i-apply ang advertisement data. status: 0x%02x"
-#, fuzzy
-#~ msgid "Group must have %q at least 1"
-#~ msgstr "Group dapat ay hindi baba sa 1 na haba"
+#~ msgid "busio.UART not available"
+#~ msgstr "busio.UART hindi available"
-#, fuzzy
-#~ msgid "buffer_size must be >= 1"
-#~ msgstr "aarehas na haba dapat ang buffer slices"
+#~ msgid "Not enough pins available"
+#~ msgstr "Hindi sapat ang magagamit na pins"
diff --git a/locale/fr.po b/locale/fr.po
index d6ff47eef..dba65e29e 100644
--- a/locale/fr.po
+++ b/locale/fr.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2019-02-14 15:42+0100\n"
+"POT-Creation-Date: 2019-02-15 19:19-0500\n"
"PO-Revision-Date: 2018-12-23 20:05+0100\n"
"Last-Translator: Pierrick Couturier <arofarn@arofarn.info>\n"
"Language-Team: fr\n"
@@ -154,7 +154,7 @@ msgstr "compilation de script non supporté"
msgid " output:\n"
msgstr " sortie:\n"
-#: main.c:166 main.c:248
+#: main.c:166 main.c:250
msgid ""
"Auto-reload is on. Simply save files over USB to run them or enter REPL to "
"disable.\n"
@@ -166,7 +166,7 @@ msgstr ""
msgid "Running in safe mode! Auto-reload is off.\n"
msgstr "Mode sans-échec. Auto-rechargement désactivé.\n"
-#: main.c:170 main.c:250
+#: main.c:170 main.c:252
msgid "Auto-reload is off.\n"
msgstr "Auto-rechargement désactivé.\n"
@@ -178,17 +178,17 @@ msgstr "Mode sans-échec! Le code sauvegardé ne s'éxecute pas.\n"
msgid "WARNING: Your code filename has two extensions\n"
msgstr "ATTENTION: le nom de fichier de votre code a deux extensions\n"
-#: main.c:221
+#: main.c:223
msgid ""
"\n"
"Code done running. Waiting for reload.\n"
msgstr ""
-#: main.c:255
+#: main.c:257
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."
-#: main.c:420
+#: main.c:422
msgid "soft reboot\n"
msgstr "redémarrage logiciel\n"
@@ -316,11 +316,7 @@ msgstr "Tous les canaux d'événements sont utilisés"
msgid "Sample rate too high. It must be less than %d"
msgstr "Taux d'échantillonage trop élevé. Doit être inf. à %d"
-#: ports/atmel-samd/common-hal/busio/I2C.c:71
-msgid "Not enough pins available"
-msgstr "Pas assez de broches disponibles"
-
-#: ports/atmel-samd/common-hal/busio/I2C.c:78
+#: ports/atmel-samd/common-hal/busio/I2C.c:74
#: ports/atmel-samd/common-hal/busio/SPI.c:176
#: ports/atmel-samd/common-hal/busio/UART.c:120
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45
@@ -328,11 +324,11 @@ msgstr "Pas assez de broches disponibles"
msgid "Invalid pins"
msgstr "Broches invalides"
-#: ports/atmel-samd/common-hal/busio/I2C.c:101
+#: ports/atmel-samd/common-hal/busio/I2C.c:97
msgid "SDA or SCL needs a pull up"
msgstr "SDA ou SCL a besoin d'une résistance de tirage ('pull up')"
-#: ports/atmel-samd/common-hal/busio/I2C.c:121
+#: ports/atmel-samd/common-hal/busio/I2C.c:117
msgid "Unsupported baudrate"
msgstr "Débit non supporté"
@@ -2914,105 +2910,108 @@ msgstr ""
"Appuyer denouveau pour quitter de le mode sans-échec.\n"
#, fuzzy
-#~ msgid "busio.UART not available"
-#~ msgstr "busio.UART n'est pas disponible"
+#~ msgid "buffer_size must be >= 1"
+#~ msgstr "les slices de tampon doivent être de longueurs égales"
-#~ msgid "Can not query for the device address."
-#~ msgstr "Impossible d'obtenir l'adresse du périphérique"
+#, fuzzy
+#~ msgid "Group must have %q at least 1"
+#~ msgstr "Le tampon doit être de longueur au moins 1"
-#~ msgid "Can not encode UUID, to check length."
-#~ msgstr "Impossible d'encoder l'UUID pour vérifier la longueur."
+#~ msgid "Cannot set PPCP parameters."
+#~ msgstr "Impossible d'appliquer les paramètres PPCP"
-#~ msgid "Cannot apply GAP parameters."
-#~ msgstr "Impossible d'appliquer les paramètres GAP"
+#~ msgid "Invalid UUID parameter"
+#~ msgstr "Paramètre UUID invalide"
-#~ msgid ""
-#~ "Please file an issue here with the contents of your CIRCUITPY drive:\n"
+#, fuzzy
+#~ msgid "row buffer must be a bytearray or array of type 'b' or 'B'"
#~ msgstr ""
-#~ "SVP, remontez le problème là avec le contenu du lecteur CIRCUITPY:\n"
+#~ "le tampon de ligne doit être un bytearray ou un tableau de type 'b' ou 'B'"
-#~ msgid "Looks like our core CircuitPython code crashed hard. Whoops!\n"
-#~ msgstr ""
-#~ "Il semblerait que votre code CircuitPython a durement planté. Oups!\n"
+#, fuzzy
+#~ msgid "row data must be a buffer"
+#~ msgstr "les données de ligne doivent être un tampon"
#, fuzzy
-#~ msgid "Wrong number of bytes provided"
-#~ msgstr "mauvais nombre d'octets fourni'"
+#~ msgid "unicode_characters must be a string"
+#~ msgstr "les noms doivent être des chaînes de caractère"
-#~ msgid ""
-#~ "enough power for the whole circuit and press reset (after ejecting "
-#~ "CIRCUITPY).\n"
-#~ msgstr ""
-#~ "assez de puissance pour l'ensemble du circuit et appuyez sur "
-#~ "'reset' (après avoir éjecter CIRCUITPY).\n"
+#~ msgid "index must be int"
+#~ msgstr "l'index doit être un entier"
#, fuzzy
-#~ msgid "unpack requires a buffer of %d bytes"
-#~ msgstr "Echec de l'allocation de %d octets du tampon RX"
-
-#~ msgid "Invalid Service type"
-#~ msgstr "Type de service invalide"
+#~ msgid "palette must be displayio.Palette"
+#~ msgstr "la palette doit être une displayio.Palette"
-#~ msgid "displayio is a work in progress"
-#~ msgstr "displayio est en cours de développement"
+#, fuzzy
+#~ msgid "All PWM peripherals are in use"
+#~ msgstr "Tous les périphériques PWM sont utilisés"
-#~ msgid "Can not apply device name in the stack."
-#~ msgstr "Impossible d'appliquer le nom de périphérique dans la pile"
+#, fuzzy
+#~ msgid "value_size must be power of two"
+#~ msgstr "value_size doit être une puissance de 2"
-#~ msgid "Invalid UUID string length"
-#~ msgstr "Longeur de chaîne UUID invalide"
+#, fuzzy
+#~ msgid "Group empty"
+#~ msgstr "Groupe vide"
-#~ msgid "Can not add Characteristic."
-#~ msgstr "Impossible d'ajouter la Characteristic."
+#~ msgid "Wrong address length"
+#~ msgstr "Mauvaise longueur d'adresse"
#~ msgid "Can not add Service."
#~ msgstr "Impossible d'ajouter le Service"
-#~ msgid "Wrong address length"
-#~ msgstr "Mauvaise longueur d'adresse"
+#~ msgid "Can not add Characteristic."
+#~ msgstr "Impossible d'ajouter la Characteristic."
-#, fuzzy
-#~ msgid "Group empty"
-#~ msgstr "Groupe vide"
+#~ msgid "Invalid UUID string length"
+#~ msgstr "Longeur de chaîne UUID invalide"
-#, fuzzy
-#~ msgid "value_size must be power of two"
-#~ msgstr "value_size doit être une puissance de 2"
+#~ msgid "Can not apply device name in the stack."
+#~ msgstr "Impossible d'appliquer le nom de périphérique dans la pile"
-#, fuzzy
-#~ msgid "All PWM peripherals are in use"
-#~ msgstr "Tous les périphériques PWM sont utilisés"
+#~ msgid "displayio is a work in progress"
+#~ msgstr "displayio est en cours de développement"
+
+#~ msgid "Invalid Service type"
+#~ msgstr "Type de service invalide"
#, fuzzy
-#~ msgid "palette must be displayio.Palette"
-#~ msgstr "la palette doit être une displayio.Palette"
+#~ msgid "unpack requires a buffer of %d bytes"
+#~ msgstr "Echec de l'allocation de %d octets du tampon RX"
-#~ msgid "index must be int"
-#~ msgstr "l'index doit être un entier"
+#~ msgid ""
+#~ "enough power for the whole circuit and press reset (after ejecting "
+#~ "CIRCUITPY).\n"
+#~ msgstr ""
+#~ "assez de puissance pour l'ensemble du circuit et appuyez sur "
+#~ "'reset' (après avoir éjecter CIRCUITPY).\n"
#, fuzzy
-#~ msgid "unicode_characters must be a string"
-#~ msgstr "les noms doivent être des chaînes de caractère"
+#~ msgid "Wrong number of bytes provided"
+#~ msgstr "mauvais nombre d'octets fourni'"
-#, fuzzy
-#~ msgid "row data must be a buffer"
-#~ msgstr "les données de ligne doivent être un tampon"
+#~ msgid "Looks like our core CircuitPython code crashed hard. Whoops!\n"
+#~ msgstr ""
+#~ "Il semblerait que votre code CircuitPython a durement planté. Oups!\n"
-#, fuzzy
-#~ msgid "row buffer must be a bytearray or array of type 'b' or 'B'"
+#~ msgid ""
+#~ "Please file an issue here with the contents of your CIRCUITPY drive:\n"
#~ msgstr ""
-#~ "le tampon de ligne doit être un bytearray ou un tableau de type 'b' ou 'B'"
+#~ "SVP, remontez le problème là avec le contenu du lecteur CIRCUITPY:\n"
-#~ msgid "Invalid UUID parameter"
-#~ msgstr "Paramètre UUID invalide"
+#~ msgid "Cannot apply GAP parameters."
+#~ msgstr "Impossible d'appliquer les paramètres GAP"
-#~ msgid "Cannot set PPCP parameters."
-#~ msgstr "Impossible d'appliquer les paramètres PPCP"
+#~ msgid "Can not encode UUID, to check length."
+#~ msgstr "Impossible d'encoder l'UUID pour vérifier la longueur."
-#, fuzzy
-#~ msgid "Group must have %q at least 1"
-#~ msgstr "Le tampon doit être de longueur au moins 1"
+#~ msgid "Can not query for the device address."
+#~ msgstr "Impossible d'obtenir l'adresse du périphérique"
#, fuzzy
-#~ msgid "buffer_size must be >= 1"
-#~ msgstr "les slices de tampon doivent être de longueurs égales"
+#~ msgid "busio.UART not available"
+#~ msgstr "busio.UART n'est pas disponible"
+
+#~ msgid "Not enough pins available"
+#~ msgstr "Pas assez de broches disponibles"
diff --git a/locale/it_IT.po b/locale/it_IT.po
index 9d9650a79..7aa4e3b43 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-02-14 15:42+0100\n"
+"POT-Creation-Date: 2019-02-15 19:19-0500\n"
"PO-Revision-Date: 2018-10-02 16:27+0200\n"
"Last-Translator: Enrico Paganin <enrico.paganin@mail.com>\n"
"Language-Team: \n"
@@ -155,7 +155,7 @@ msgstr "compilazione dello scrip non suportata"
msgid " output:\n"
msgstr " output:\n"
-#: main.c:166 main.c:248
+#: main.c:166 main.c:250
msgid ""
"Auto-reload is on. Simply save files over USB to run them or enter REPL to "
"disable.\n"
@@ -167,7 +167,7 @@ msgstr ""
msgid "Running in safe mode! Auto-reload is off.\n"
msgstr "Modalità sicura in esecuzione! Auto-reload disattivato.\n"
-#: main.c:170 main.c:250
+#: main.c:170 main.c:252
msgid "Auto-reload is off.\n"
msgstr "Auto-reload disattivato.\n"
@@ -179,18 +179,18 @@ msgstr "Modalità sicura in esecuzione! Codice salvato non in esecuzione.\n"
msgid "WARNING: Your code filename has two extensions\n"
msgstr "ATTENZIONE: Il nome del sorgente ha due estensioni\n"
-#: main.c:221
+#: main.c:223
msgid ""
"\n"
"Code done running. Waiting for reload.\n"
msgstr ""
-#: main.c:255
+#: main.c:257
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr ""
"Premi un qualunque tasto per entrare nel REPL. Usa CTRL-D per ricaricare."
-#: main.c:420
+#: main.c:422
msgid "soft reboot\n"
msgstr "soft reboot\n"
@@ -320,11 +320,7 @@ msgid "Sample rate too high. It must be less than %d"
msgstr ""
"Frequenza di campionamento troppo alta. Il valore deve essere inferiore a %d"
-#: ports/atmel-samd/common-hal/busio/I2C.c:71
-msgid "Not enough pins available"
-msgstr "Non sono presenti abbastanza pin"
-
-#: ports/atmel-samd/common-hal/busio/I2C.c:78
+#: ports/atmel-samd/common-hal/busio/I2C.c:74
#: ports/atmel-samd/common-hal/busio/SPI.c:176
#: ports/atmel-samd/common-hal/busio/UART.c:120
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45
@@ -332,11 +328,11 @@ msgstr "Non sono presenti abbastanza pin"
msgid "Invalid pins"
msgstr "Pin non validi"
-#: ports/atmel-samd/common-hal/busio/I2C.c:101
+#: ports/atmel-samd/common-hal/busio/I2C.c:97
msgid "SDA or SCL needs a pull up"
msgstr "SDA o SCL necessitano un pull-up"
-#: ports/atmel-samd/common-hal/busio/I2C.c:121
+#: ports/atmel-samd/common-hal/busio/I2C.c:117
msgid "Unsupported baudrate"
msgstr "baudrate non supportato"
@@ -2888,96 +2884,99 @@ msgid ""
msgstr ""
#, fuzzy
-#~ msgid "busio.UART not available"
-#~ msgstr "busio.UART non ancora implementato"
+#~ msgid "buffer_size must be >= 1"
+#~ msgstr "slice del buffer devono essere della stessa lunghezza"
-#~ msgid "Can not encode UUID, to check length."
-#~ msgstr "Non è possibile codificare l'UUID, lunghezza da controllare."
+#~ msgid "row data must be a buffer"
+#~ msgstr "valori della riga devono essere un buffer"
#, fuzzy
-#~ msgid "unpack requires a buffer of %d bytes"
-#~ msgstr "Fallita allocazione del buffer RX di %d byte"
+#~ msgid "Group must have %q at least 1"
+#~ msgstr "Il gruppo deve avere dimensione almeno 1"
-#~ msgid "Invalid UUID string length"
-#~ msgstr "Lunghezza della stringa UUID non valida"
+#~ msgid "Invalid UUID parameter"
+#~ msgstr "Parametro UUID non valido"
-#~ msgid ""
-#~ "enough power for the whole circuit and press reset (after ejecting "
-#~ "CIRCUITPY).\n"
-#~ msgstr ""
-#~ "abbastanza potenza per l'intero circuito e premere reset (dopo aver "
-#~ "espulso CIRCUITPY).\n"
+#~ msgid "Group empty"
+#~ msgstr "Gruppo vuoto"
-#~ msgid "Can not add Service."
-#~ msgstr "Non è possibile aggiungere Service."
+#, fuzzy
+#~ msgid "All PWM peripherals are in use"
+#~ msgstr "Tutte le periferiche SPI sono in uso"
-#~ msgid "Can encode UUID into the advertisement packet."
-#~ msgstr "È possibile codificare l'UUID nel pacchetto di advertisement."
+#~ msgid "row buffer must be a bytearray or array of type 'b' or 'B'"
+#~ msgstr ""
+#~ "buffer di riga deve essere un bytearray o un array di tipo 'b' o 'B'"
-#~ msgid "Can not apply device name in the stack."
-#~ msgstr "Non è possibile inserire il nome del dipositivo nella lista."
+#, fuzzy
+#~ msgid "unicode_characters must be a string"
+#~ msgstr "argomenti nominati devono essere stringhe"
-#~ msgid "Cannot set PPCP parameters."
-#~ msgstr "Impossibile impostare i parametri PPCP."
+#~ msgid "index must be int"
+#~ msgstr "l'indice deve essere int"
-#~ msgid "Can not query for the device address."
-#~ msgstr "Non è possibile trovare l'indirizzo del dispositivo."
+#~ msgid "Invalid Service type"
+#~ msgstr "Tipo di servizio non valido"
-#~ msgid ""
-#~ "Please file an issue here with the contents of your CIRCUITPY drive:\n"
+#, fuzzy
+#~ msgid "Wrong number of bytes provided"
+#~ msgstr "numero di argomenti errato"
+
+#~ msgid "Looks like our core CircuitPython code crashed hard. Whoops!\n"
#~ msgstr ""
-#~ "Ti preghiamo di compilare una issue con il contenuto del tuo drie "
-#~ "CIRCUITPY:\n"
+#~ "Sembra che il codice del core di CircuitPython sia crashato malamente. "
+#~ "Whoops!\n"
-#~ msgid "Can not apply advertisement data. status: 0x%02x"
-#~ msgstr "Impossible inserire dati advertisement. status: 0x%02x"
+#~ msgid "Can not add Characteristic."
+#~ msgstr "Non è possibile aggiungere Characteristic."
#~ msgid "Cannot apply GAP parameters."
#~ msgstr "Impossibile applicare i parametri GAP."
-#~ msgid "Can not add Characteristic."
-#~ msgstr "Non è possibile aggiungere Characteristic."
+#~ msgid "Can not apply advertisement data. status: 0x%02x"
+#~ msgstr "Impossible inserire dati advertisement. status: 0x%02x"
-#~ msgid "Looks like our core CircuitPython code crashed hard. Whoops!\n"
+#~ msgid ""
+#~ "Please file an issue here with the contents of your CIRCUITPY drive:\n"
#~ msgstr ""
-#~ "Sembra che il codice del core di CircuitPython sia crashato malamente. "
-#~ "Whoops!\n"
-
-#, fuzzy
-#~ msgid "Wrong number of bytes provided"
-#~ msgstr "numero di argomenti errato"
+#~ "Ti preghiamo di compilare una issue con il contenuto del tuo drie "
+#~ "CIRCUITPY:\n"
-#~ msgid "Invalid Service type"
-#~ msgstr "Tipo di servizio non valido"
+#~ msgid "Can not query for the device address."
+#~ msgstr "Non è possibile trovare l'indirizzo del dispositivo."
-#~ msgid "index must be int"
-#~ msgstr "l'indice deve essere int"
+#~ msgid "Cannot set PPCP parameters."
+#~ msgstr "Impossibile impostare i parametri PPCP."
-#, fuzzy
-#~ msgid "unicode_characters must be a string"
-#~ msgstr "argomenti nominati devono essere stringhe"
+#~ msgid "Can not apply device name in the stack."
+#~ msgstr "Non è possibile inserire il nome del dipositivo nella lista."
-#~ msgid "row buffer must be a bytearray or array of type 'b' or 'B'"
-#~ msgstr ""
-#~ "buffer di riga deve essere un bytearray o un array di tipo 'b' o 'B'"
+#~ msgid "Can encode UUID into the advertisement packet."
+#~ msgstr "È possibile codificare l'UUID nel pacchetto di advertisement."
-#, fuzzy
-#~ msgid "All PWM peripherals are in use"
-#~ msgstr "Tutte le periferiche SPI sono in uso"
+#~ msgid "Can not add Service."
+#~ msgstr "Non è possibile aggiungere Service."
-#~ msgid "Group empty"
-#~ msgstr "Gruppo vuoto"
+#~ msgid ""
+#~ "enough power for the whole circuit and press reset (after ejecting "
+#~ "CIRCUITPY).\n"
+#~ msgstr ""
+#~ "abbastanza potenza per l'intero circuito e premere reset (dopo aver "
+#~ "espulso CIRCUITPY).\n"
-#~ msgid "Invalid UUID parameter"
-#~ msgstr "Parametro UUID non valido"
+#~ msgid "Invalid UUID string length"
+#~ msgstr "Lunghezza della stringa UUID non valida"
#, fuzzy
-#~ msgid "Group must have %q at least 1"
-#~ msgstr "Il gruppo deve avere dimensione almeno 1"
+#~ msgid "unpack requires a buffer of %d bytes"
+#~ msgstr "Fallita allocazione del buffer RX di %d byte"
-#~ msgid "row data must be a buffer"
-#~ msgstr "valori della riga devono essere un buffer"
+#~ msgid "Can not encode UUID, to check length."
+#~ msgstr "Non è possibile codificare l'UUID, lunghezza da controllare."
#, fuzzy
-#~ msgid "buffer_size must be >= 1"
-#~ msgstr "slice del buffer devono essere della stessa lunghezza"
+#~ msgid "busio.UART not available"
+#~ msgstr "busio.UART non ancora implementato"
+
+#~ msgid "Not enough pins available"
+#~ msgstr "Non sono presenti abbastanza pin"
diff --git a/locale/pt_BR.po b/locale/pt_BR.po
index 9b2b1c265..1e204a42f 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-02-14 15:42+0100\n"
+"POT-Creation-Date: 2019-02-15 19:19-0500\n"
"PO-Revision-Date: 2018-10-02 21:14-0000\n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -155,7 +155,7 @@ msgstr "compilação de script não suportada"
msgid " output:\n"
msgstr " saída:\n"
-#: main.c:166 main.c:248
+#: main.c:166 main.c:250
msgid ""
"Auto-reload is on. Simply save files over USB to run them or enter REPL to "
"disable.\n"
@@ -165,7 +165,7 @@ msgstr ""
msgid "Running in safe mode! Auto-reload is off.\n"
msgstr "Rodando em modo seguro! Atualização automática está desligada.\n"
-#: main.c:170 main.c:250
+#: main.c:170 main.c:252
msgid "Auto-reload is off.\n"
msgstr "A atualização automática está desligada.\n"
@@ -177,17 +177,17 @@ msgstr "Rodando em modo seguro! Não está executando o código salvo.\n"
msgid "WARNING: Your code filename has two extensions\n"
msgstr "AVISO: Seu arquivo de código tem duas extensões\n"
-#: main.c:221
+#: main.c:223
msgid ""
"\n"
"Code done running. Waiting for reload.\n"
msgstr ""
-#: main.c:255
+#: main.c:257
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr ""
-#: main.c:420
+#: main.c:422
msgid "soft reboot\n"
msgstr ""
@@ -315,11 +315,7 @@ msgstr "Todos os canais de eventos em uso"
msgid "Sample rate too high. It must be less than %d"
msgstr "Taxa de amostragem muito alta. Deve ser menor que %d"
-#: ports/atmel-samd/common-hal/busio/I2C.c:71
-msgid "Not enough pins available"
-msgstr "Não há pinos suficientes disponíveis"
-
-#: ports/atmel-samd/common-hal/busio/I2C.c:78
+#: ports/atmel-samd/common-hal/busio/I2C.c:74
#: ports/atmel-samd/common-hal/busio/SPI.c:176
#: ports/atmel-samd/common-hal/busio/UART.c:120
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45
@@ -327,11 +323,11 @@ msgstr "Não há pinos suficientes disponíveis"
msgid "Invalid pins"
msgstr "Pinos inválidos"
-#: ports/atmel-samd/common-hal/busio/I2C.c:101
+#: ports/atmel-samd/common-hal/busio/I2C.c:97
msgid "SDA or SCL needs a pull up"
msgstr "SDA ou SCL precisa de um pull up"
-#: ports/atmel-samd/common-hal/busio/I2C.c:121
+#: ports/atmel-samd/common-hal/busio/I2C.c:117
msgid "Unsupported baudrate"
msgstr "Taxa de transmissão não suportada"
@@ -2835,61 +2831,64 @@ msgid ""
"exit safe mode.\n"
msgstr ""
-#~ msgid "busio.UART not available"
-#~ msgstr "busio.UART não disponível"
-
#, fuzzy
-#~ msgid "All PWM peripherals are in use"
-#~ msgstr "Todos os temporizadores em uso"
+#~ msgid "buffer_size must be >= 1"
+#~ msgstr "buffers devem ser o mesmo tamanho"
-#~ msgid "Can not add Characteristic."
-#~ msgstr "Não é possível adicionar Característica."
+#~ msgid "index must be int"
+#~ msgstr "index deve ser int"
-#~ msgid "Can not apply advertisement data. status: 0x%02x"
-#~ msgstr "Não é possível aplicar dados de anúncio. status: 0x%02x"
+#, fuzzy
+#~ msgid "Group must have %q at least 1"
+#~ msgstr "Grupo deve ter tamanho pelo menos 1"
-#~ msgid "Cannot apply GAP parameters."
-#~ msgstr "Não é possível aplicar parâmetros GAP."
+#~ msgid "Group empty"
+#~ msgstr "Grupo vazio"
-#~ msgid "Can not apply device name in the stack."
-#~ msgstr "Não é possível aplicar o nome do dispositivo na pilha."
+#, fuzzy
+#~ msgid "unicode_characters must be a string"
+#~ msgstr "heap deve ser uma lista"
-#~ msgid "Cannot set PPCP parameters."
-#~ msgstr "Não é possível definir parâmetros PPCP."
+#~ msgid "Invalid UUID parameter"
+#~ msgstr "Parâmetro UUID inválido"
-#~ msgid "Invalid Service type"
-#~ msgstr "Tipo de serviço inválido"
+#~ msgid "Baud rate too high for this SPI peripheral"
+#~ msgstr "Taxa de transmissão muito alta para esse periférico SPI"
-#~ msgid "Can not query for the device address."
-#~ msgstr "Não é possível consultar o endereço do dispositivo."
+#~ msgid "Can encode UUID into the advertisement packet."
+#~ msgstr "Pode codificar o UUID no pacote de anúncios."
#, fuzzy
#~ msgid "unpack requires a buffer of %d bytes"
#~ msgstr "Falha ao alocar buffer RX de %d bytes"
-#~ msgid "Can encode UUID into the advertisement packet."
-#~ msgstr "Pode codificar o UUID no pacote de anúncios."
+#~ msgid "Can not query for the device address."
+#~ msgstr "Não é possível consultar o endereço do dispositivo."
-#~ msgid "Baud rate too high for this SPI peripheral"
-#~ msgstr "Taxa de transmissão muito alta para esse periférico SPI"
+#~ msgid "Invalid Service type"
+#~ msgstr "Tipo de serviço inválido"
-#~ msgid "Invalid UUID parameter"
-#~ msgstr "Parâmetro UUID inválido"
+#~ msgid "Cannot set PPCP parameters."
+#~ msgstr "Não é possível definir parâmetros PPCP."
-#, fuzzy
-#~ msgid "unicode_characters must be a string"
-#~ msgstr "heap deve ser uma lista"
+#~ msgid "Can not apply device name in the stack."
+#~ msgstr "Não é possível aplicar o nome do dispositivo na pilha."
-#~ msgid "Group empty"
-#~ msgstr "Grupo vazio"
+#~ msgid "Cannot apply GAP parameters."
+#~ msgstr "Não é possível aplicar parâmetros GAP."
-#, fuzzy
-#~ msgid "Group must have %q at least 1"
-#~ msgstr "Grupo deve ter tamanho pelo menos 1"
+#~ msgid "Can not apply advertisement data. status: 0x%02x"
+#~ msgstr "Não é possível aplicar dados de anúncio. status: 0x%02x"
-#~ msgid "index must be int"
-#~ msgstr "index deve ser int"
+#~ msgid "Can not add Characteristic."
+#~ msgstr "Não é possível adicionar Característica."
#, fuzzy
-#~ msgid "buffer_size must be >= 1"
-#~ msgstr "buffers devem ser o mesmo tamanho"
+#~ msgid "All PWM peripherals are in use"
+#~ msgstr "Todos os temporizadores em uso"
+
+#~ msgid "busio.UART not available"
+#~ msgstr "busio.UART não disponível"
+
+#~ msgid "Not enough pins available"
+#~ msgstr "Não há pinos suficientes disponíveis"
diff --git a/main.c b/main.c
index c1244f36c..fac9864e3 100755
--- a/main.c
+++ b/main.c
@@ -58,7 +58,7 @@
#include "supervisor/shared/stack.h"
#include "supervisor/serial.h"
-#ifdef MICROPY_PY_NETWORK
+#if CIRCUITPY_NETWORK
#include "shared-module/network/__init__.h"
#endif
@@ -118,13 +118,13 @@ void start_mp(supervisor_allocation* heap) {
mp_obj_list_init(mp_sys_argv, 0);
- #if MICROPY_PY_NETWORK
+ #if CIRCUITPY_NETWORK
network_module_init();
#endif
}
void stop_mp(void) {
- #if MICROPY_PY_NETWORK
+ #if CIRCUITPY_NETWORK
network_module_deinit();
#endif
}
@@ -201,7 +201,9 @@ bool run_code_py(safe_mode_t safe_mode) {
}
}
// Turn off the display before the heap disappears.
+ #if CIRCUITPY_DISPLAYIO
reset_displays();
+ #endif
stop_mp();
free_memory(heap);
supervisor_move_memory();
diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile
index 56a858177..b608f3a20 100644
--- a/ports/atmel-samd/Makefile
+++ b/ports/atmel-samd/Makefile
@@ -1,3 +1,27 @@
+# This file is part of the MicroPython project, http://micropython.org/
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2019 Dan Halbert for Adafruit Industries
+#
+# 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.
+
# Select the board to build for.
ifeq ($(BOARD),)
$(error You must provide a BOARD parameter)
@@ -7,13 +31,16 @@ else
endif
endif
-
# If the build directory is not given, make it reflect the board name.
BUILD ?= build-$(BOARD)
include ../../py/mkenv.mk
+# Board-specific
include boards/$(BOARD)/mpconfigboard.mk
--include mpconfigport.mk
+# Port-specific
+include mpconfigport.mk
+# CircuitPython-specific
+include $(TOP)/py/circuitpy_mpconfig.mk
# qstr definitions (must come before including py.mk)
QSTR_DEFS = qstrdefsport.h
@@ -23,9 +50,10 @@ include $(TOP)/py/py.mk
include $(TOP)/supervisor/supervisor.mk
-CROSS_COMPILE = arm-none-eabi-
+# Include make rules and variables common across CircuitPython builds.
+include $(TOP)/py/circuitpy_defns.mk
-BOSSAC := tools/bossac_osx
+CROSS_COMPILE = arm-none-eabi-
HAL_DIR=hal/$(MCU_SERIES)
@@ -54,36 +82,6 @@ INC += -I. \
-I../../supervisor/shared/usb \
-I$(BUILD)
-BASE_CFLAGS = \
- -fsingle-precision-constant \
- -fno-strict-aliasing \
- -Wdouble-promotion \
- -Wno-endif-labels \
- -Wstrict-prototypes \
- -Werror-implicit-function-declaration \
- -Wfloat-equal \
- -Wundef \
- -Wshadow \
- -Wwrite-strings \
- -Wsign-compare \
- -Wmissing-format-attribute \
- -Wno-deprecated-declarations \
- -Wnested-externs \
- -Wunreachable-code \
- -Wcast-align \
- -Wno-error=lto-type-mismatch \
- -D__$(CHIP_VARIANT)__ \
- -ffunction-sections \
- -fdata-sections \
- -fshort-enums \
- -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF \
- -DCIRCUITPY_CANARY_WORD=0xADAF00 \
- -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF \
- --param max-inline-insns-single=500
-
-# Use these flags to debug build times and header includes.
-# -ftime-report
-# -H
# NDEBUG disables assert() statements. This reduces code size pretty dramatically, per tannewt.
@@ -144,22 +142,7 @@ CFLAGS += \
-DSAMD51
endif
-ifneq ($(FROZEN_DIR),)
-# To use frozen source modules, put your .py files in a subdirectory (eg scripts/)
-# and then invoke make with FROZEN_DIR=scripts (be sure to build from scratch).
-CFLAGS += -DMICROPY_MODULE_FROZEN_STR
-CFLAGS += -Wno-error=lto-type-mismatch
-endif
-
-# To use frozen bytecode, put your .py files in a subdirectory (eg frozen/) and
-# then invoke make with FROZEN_MPY_DIR=frozen or FROZEN_MPY_DIRS="dir1 dir2"
-# (be sure to build from scratch).
-ifneq ($(FROZEN_MPY_DIRS),)
-CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
-CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
-CFLAGS += -Wno-error=lto-type-mismatch
-endif
LDFLAGS = $(CFLAGS) -nostartfiles -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs
LIBS := -lgcc -lc
@@ -169,20 +152,6 @@ ifndef INTERNAL_LIBM
LIBS += -lm
endif
-# Propagate longint choice from .mk to C. There's no easy string comparison
-# in cpp coniditionals, so we #define separate names for each.
-ifeq ($(LONGINT_IMPL),NONE)
-CFLAGS += -DLONGINT_IMPL_NONE
-endif
-
-ifeq ($(LONGINT_IMPL),MPZ)
-CFLAGS += -DLONGINT_IMPL_MPZ
-endif
-
-ifeq ($(LONGINT_IMPL),LONGLONG)
-CFLAGS += -DLONGINT_IMPL_LONGLONG
-endif
-
ifeq ($(CHIP_FAMILY), samd21)
LDFLAGS += -mthumb -mcpu=cortex-m0plus -Lasf/thirdparty/CMSIS/Lib/GCC/
BOOTLOADER_SIZE := 0x2000
@@ -191,10 +160,6 @@ LDFLAGS += -mthumb -mcpu=cortex-m4
BOOTLOADER_SIZE := 0x4000
endif
-ifdef EXCLUDE_PIXELBUF
-CFLAGS += -DEXCLUDE_PIXELBUF
-endif
-
SRC_ASF := \
gcc/gcc/startup_$(CHIP_FAMILY).c \
gcc/system_$(CHIP_FAMILY).c \
@@ -243,29 +208,14 @@ SRC_ASF := $(addprefix asf4/$(CHIP_FAMILY)/, $(SRC_ASF))
SRC_C = \
audio_dma.c \
background.c \
- fatfs_port.c \
- mphalport.c \
- reset.c \
- peripherals/samd/clocks.c \
- peripherals/samd/dma.c \
- peripherals/samd/events.c \
- peripherals/samd/external_interrupts.c \
- peripherals/samd/sercom.c \
- peripherals/samd/timers.c \
- peripherals/samd/$(CHIP_FAMILY)/adc.c \
- peripherals/samd/$(CHIP_FAMILY)/cache.c \
- peripherals/samd/$(CHIP_FAMILY)/clocks.c \
- peripherals/samd/$(CHIP_FAMILY)/dma.c \
- peripherals/samd/$(CHIP_FAMILY)/events.c \
- peripherals/samd/$(CHIP_FAMILY)/external_interrupts.c \
- peripherals/samd/$(CHIP_FAMILY)/pins.c \
- peripherals/samd/$(CHIP_FAMILY)/sercom.c \
- peripherals/samd/$(CHIP_FAMILY)/timers.c \
- tick.c \
- bindings/samd/__init__.c \
bindings/samd/Clock.c \
+ bindings/samd/__init__.c \
boards/$(BOARD)/board.c \
boards/$(BOARD)/pins.c \
+ fatfs_port.c \
+ freetouch/adafruit_ptc.c \
+ lib/libc/string0.c \
+ lib/mp-readline/readline.c \
lib/oofatfs/ff.c \
lib/oofatfs/option/ccsbcs.c \
lib/timeutils/timeutils.c \
@@ -276,12 +226,28 @@ SRC_C = \
lib/utils/pyexec.c \
lib/utils/stdout_helpers.c \
lib/utils/sys_stdio_mphal.c \
- lib/libc/string0.c \
- lib/mp-readline/readline.c \
- freetouch/adafruit_ptc.c \
- supervisor/shared/memory.c
+ mphalport.c \
+ peripherals/samd/$(CHIP_FAMILY)/adc.c \
+ peripherals/samd/$(CHIP_FAMILY)/cache.c \
+ peripherals/samd/$(CHIP_FAMILY)/clocks.c \
+ peripherals/samd/$(CHIP_FAMILY)/dma.c \
+ peripherals/samd/$(CHIP_FAMILY)/events.c \
+ peripherals/samd/$(CHIP_FAMILY)/external_interrupts.c \
+ peripherals/samd/$(CHIP_FAMILY)/pins.c \
+ peripherals/samd/$(CHIP_FAMILY)/sercom.c \
+ peripherals/samd/$(CHIP_FAMILY)/timers.c \
+ peripherals/samd/clocks.c \
+ peripherals/samd/dma.c \
+ peripherals/samd/events.c \
+ peripherals/samd/external_interrupts.c \
+ peripherals/samd/sercom.c \
+ peripherals/samd/timers.c \
+ reset.c \
+ supervisor/shared/memory.c \
+ tick.c \
+
-ifeq ($(MICROPY_PY_NETWORK),1)
+ifeq ($(CIRCUITPY_NETWORK),1)
CFLAGS += -DMICROPY_PY_NETWORK=1
SRC_MOD += lib/netutils/netutils.c
@@ -299,152 +265,17 @@ SRC_MOD += $(addprefix $(WIZNET5K_DIR)/,\
)
endif # MICROPY_PY_WIZNET5K
-endif # MICROPY_PY_NETWORK
-
-SRC_COMMON_HAL = \
- board/__init__.c \
- busio/__init__.c \
- busio/I2C.c \
- busio/SPI.c \
- busio/UART.c \
- digitalio/__init__.c \
- digitalio/DigitalInOut.c \
- displayio/ParallelBus.c \
- i2cslave/__init__.c \
- i2cslave/I2CSlave.c \
- microcontroller/__init__.c \
- microcontroller/Pin.c \
- microcontroller/Processor.c \
- neopixel_write/__init__.c \
- os/__init__.c \
- rotaryio/__init__.c \
- rotaryio/IncrementalEncoder.c \
- rtc/__init__.c \
- rtc/RTC.c \
- supervisor/__init__.c \
- supervisor/Runtime.c \
- time/__init__.c \
- analogio/__init__.c \
- analogio/AnalogIn.c \
- analogio/AnalogOut.c \
- nvm/__init__.c \
- nvm/ByteArray.c \
- pulseio/__init__.c \
- pulseio/PulseIn.c \
- pulseio/PulseOut.c \
- pulseio/PWMOut.c \
- touchio/__init__.c \
- touchio/TouchIn.c
-
-ifeq ($(INTERNAL_LIBM),1)
-SRC_LIBM = $(addprefix lib/,\
- libm/math.c \
- libm/roundf.c \
- libm/fmodf.c \
- libm/nearbyintf.c \
- libm/ef_sqrt.c \
- libm/kf_rem_pio2.c \
- libm/kf_sin.c \
- libm/kf_cos.c \
- libm/kf_tan.c \
- libm/ef_rem_pio2.c \
- libm/sf_sin.c \
- libm/sf_cos.c \
- libm/sf_tan.c \
- libm/sf_frexp.c \
- libm/sf_modf.c \
- libm/sf_ldexp.c \
- libm/asinfacosf.c \
- libm/atanf.c \
- libm/atan2f.c \
- )
-endif
+endif # CIRCUITPY_NETWORK
-# These don't have corresponding files in each port but are still located in
-# shared-bindings to make it clear what the contents of the modules are.
-SRC_BINDINGS_ENUMS = \
- digitalio/Direction.c \
- digitalio/DriveMode.c \
- digitalio/Pull.c \
- displayio/Glyph.c \
- microcontroller/RunMode.c \
- help.c \
- math/__init__.c \
- supervisor/__init__.c \
- util.c
-
-
-SRC_SHARED_MODULE = \
- bitbangio/__init__.c \
- bitbangio/I2C.c \
- bitbangio/OneWire.c \
- bitbangio/SPI.c \
- busio/OneWire.c \
- displayio/__init__.c \
- displayio/Bitmap.c \
- displayio/BuiltinFont.c \
- displayio/ColorConverter.c \
- displayio/Display.c \
- displayio/FourWire.c \
- displayio/Group.c \
- displayio/OnDiskBitmap.c \
- displayio/Palette.c \
- displayio/Shape.c \
- displayio/TileGrid.c \
- gamepad/__init__.c \
- gamepad/GamePad.c \
- _stage/__init__.c \
- _stage/Layer.c \
- _stage/Text.c \
- storage/__init__.c \
- os/__init__.c \
- random/__init__.c \
- struct/__init__.c \
- terminalio/__init__.c \
- terminalio/Terminal.c \
- uheap/__init__.c \
- ustack/__init__.c \
- usb_hid/__init__.c \
- usb_hid/Device.c
-
- # usb_midi/__init__.c
- # usb_midi/Port.c
-
-ifeq ($(MICROPY_PY_NETWORK),1)
-SRC_SHARED_MODULE += socket/__init__.c network/__init__.c
+ifeq ($(CIRCUITPY_NETWORK),1)
ifneq ($(MICROPY_PY_WIZNET5K),0)
SRC_SHARED_MODULE += wiznet/__init__.c wiznet/wiznet5k.c
endif
endif
-# SAMRs don't have a DAC
-ifneq ($(CHIP_VARIANT),SAMR21G18A)
- SRC_COMMON_HAL += \
- audioio/__init__.c \
- audioio/AudioOut.c
- SRC_SHARED_MODULE += \
- audioio/__init__.c \
- audioio/Mixer.c \
- audioio/RawSample.c \
- audioio/WaveFile.c
-endif
-
-ifndef EXCLUDE_PIXELBUF
- SRC_SHARED_MODULE += _pixelbuf/__init__.c \
- _pixelbuf/PixelBuf.c
-endif
-
# The smallest SAMD51 packages don't have I2S. Everything else does.
-ifneq ($(CHIP_VARIANT),SAMD51G18A)
- ifneq ($(CHIP_VARIANT),SAMD51G19A)
- ifneq ($(CHIP_VARIANT),SAMR21G18A)
- SRC_COMMON_HAL += \
- audiobusio/__init__.c \
- audiobusio/I2SOut.c \
- audiobusio/PDMIn.c
- SRC_C += peripherals/samd/i2s.c peripherals/samd/$(CHIP_FAMILY)/i2s.c
- endif
- endif
+ifeq ($(CIRCUITPY_AUDIOBUSIO),1)
+SRC_C += peripherals/samd/i2s.c peripherals/samd/$(CHIP_FAMILY)/i2s.c
endif
SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \
@@ -466,7 +297,7 @@ endif
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o))
-SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) $(STM_SRC_C)
+SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED)
# Sources that only hold QSTRs after pre-processing.
SRC_QSTR_PREPROCESSOR += peripherals/samd/$(CHIP_FAMILY)/clocks.c
@@ -485,20 +316,9 @@ $(BUILD)/firmware.uf2: $(BUILD)/firmware.bin
$(STEPECHO) "Create $@"
$(Q)$(PYTHON3) $(TOP)/tools/uf2/utils/uf2conv.py -b $(BOOTLOADER_SIZE) -c -o $@ $^
-deploy: $(BUILD)/firmware.bin
- $(ECHO) "Writing $< to the board"
- $(BOSSAC) -u $<
-
-# Run emulation build on a POSIX system with suitable terminal settings
-run:
- stty raw opost -echo
- build/firmware.elf
- @echo Resetting terminal...
-# This sleep is useful to spot segfaults
- sleep 1
- reset
-
-test: $(BUILD)/firmware.elf
- $(Q)/bin/echo -e "print('hello world!', list(x+1 for x in range(10)), end='eol\\\\n')\\r\\n\\x04" | $(BUILD)/firmware.elf | tail -n2 | grep "^hello world! \\[1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\]eol"
-
include $(TOP)/py/mkrules.mk
+
+# Print out the value of a make variable.
+# https://stackoverflow.com/questions/16467718/how-to-print-out-a-variable-in-makefile
+print-%:
+ @echo $* = $($*)
diff --git a/ports/atmel-samd/background.c b/ports/atmel-samd/background.c
index 4f3257f3f..519d0eeec 100644
--- a/ports/atmel-samd/background.c
+++ b/ports/atmel-samd/background.c
@@ -46,11 +46,11 @@ void run_background_tasks(void) {
#if (defined(SAMD21) && defined(PIN_PA02)) || defined(SAMD51)
audio_dma_background();
#endif
- #ifdef CIRCUITPY_DISPLAYIO
+ #if CIRCUITPY_DISPLAYIO
displayio_refresh_displays();
#endif
- #if MICROPY_PY_NETWORK
+ #if CIRCUITPY_NETWORK
network_module_background();
#endif
usb_background();
diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk
index 071f7e64c..bafb8a96c 100644
--- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk
@@ -6,6 +6,7 @@ USB_MANUFACTURER = "Arduino"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
+CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
diff --git a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk
index 309351289..b6df8d6e2 100644
--- a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk
@@ -6,6 +6,7 @@ USB_MANUFACTURER = "Arduino"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
+CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
diff --git a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk
index 28c79d6e4..af953e8c2 100644
--- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk
@@ -6,8 +6,7 @@ USB_MANUFACTURER = "Arduino"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
+CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
-
-EXCLUDE_PIXELBUF = 1
diff --git a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk
index fd4590166..bb567ddd4 100644
--- a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk
@@ -6,6 +6,7 @@ USB_MANUFACTURER = "Electronic Cats"
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.h b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h
index 6d926778e..e6a7e0676 100644
--- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h
+++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h
@@ -46,5 +46,3 @@
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
-
-#define CIRCUITPY_DISPLAYIO (0)
diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk
index f701ef173..aacffffe0 100644
--- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk
@@ -9,6 +9,9 @@ EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
LONGINT_IMPL = MPZ
+# Make room for frozen libs.
+CIRCUITPY_DISPLAYIO = 0
+
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h
index 5c3be69dd..ca6f9b773 100644
--- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h
+++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h
@@ -3,9 +3,6 @@
#define MICROPY_HW_LED_STATUS (&pin_PA17)
-// No framebuf on CRICKit version to save space.
-#define MICROPY_PY_FRAMEBUF (0)
-
// Don't allow touch on A0 (PA02), because it's connected to the speaker.
#define PA02_NO_TOUCH (true)
@@ -49,5 +46,3 @@
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
-
-#define CIRCUITPY_DISPLAYIO (0)
diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk
index e1e7484d5..eed40f902 100644
--- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk
@@ -9,8 +9,9 @@ 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
-# Disable pixelbuf to save room
-EXCLUDE_PIXELBUF = 1
+
+CIRCUITPY_DISPLAYIO = 0
+CIRCUITPY_PIXELBUF = 0
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
diff --git a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk
index 63acd03b4..0fba81ac0 100644
--- a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk
@@ -8,5 +8,10 @@ QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = "W25Q128JV_PM"
+# No I2S on SAMD51G
+CIRCUITPY_AUDIOBUSIO = 0
+# No touch on SAMD51 yet
+CIRCUITPY_TOUCHIO = 0
+
CHIP_VARIANT = SAMD51G19A
CHIP_FAMILY = samd51
diff --git a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.h b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.h
index c73440f0e..99167d31b 100644
--- a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.h
+++ b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.h
@@ -43,6 +43,3 @@
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
-
-#define CIRCUITPY_I2CSLAVE
-#define CIRCUITPY_DISPLAYIO (1)
diff --git a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk
index 162b2ca48..e6b21e25b 100644
--- a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk
@@ -13,5 +13,8 @@ LONGINT_IMPL = MPZ
CHIP_VARIANT = SAMD51J19A
CHIP_FAMILY = samd51
-MICROPY_PY_NETWORK = 1
+# No touch on SAMD51 yet
+CIRCUITPY_TOUCHIO = 0
+
+CIRCUITPY_NETWORK = 1
MICROPY_PY_WIZNET5K = 5500
diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk
index 687a27df3..26e3b7d4d 100644
--- a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk
@@ -6,8 +6,7 @@ USB_MANUFACTURER = "Adafruit Industries LLC"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
+CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
-
-EXCLUDE_PIXELBUF = 1
diff --git a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk
index a77da91f2..102cb656f 100644
--- a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk
@@ -6,6 +6,7 @@ USB_MANUFACTURER = "Adafruit Industries LLC"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
+CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
diff --git a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.h
index 7c10a92ec..e6cd1c729 100644
--- a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.h
+++ b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.h
@@ -37,5 +37,3 @@
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
-
-#define CIRCUITPY_I2CSLAVE
diff --git a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk
index 57ce96285..989a676a5 100644
--- a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk
@@ -12,5 +12,5 @@ LONGINT_IMPL = MPZ
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
-MICROPY_PY_NETWORK = 1
+CIRCUITPY_NETWORK = 1
MICROPY_PY_WIZNET5K = 5500
diff --git a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.h
index 4a5004b3a..abbf0b08c 100644
--- a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.h
+++ b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.h
@@ -32,5 +32,3 @@
#define DEFAULT_UART_BUS_RX (&pin_PA11)
#define DEFAULT_UART_BUS_TX (&pin_PA10)
-
-#define CIRCUITPY_DISPLAYIO (0)
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 f773bcb57..c6dc73d39 100644
--- a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk
@@ -9,6 +9,9 @@ EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
LONGINT_IMPL = MPZ
+# Make space for frozen libs
+CIRCUITPY_DISPLAYIO = 0
+
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk
index bd1a96479..ce3f8668c 100644
--- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk
@@ -6,6 +6,7 @@ USB_MANUFACTURER = "Adafruit Industries LLC"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
+CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk
index fedd8d072..282977338 100644
--- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk
@@ -6,6 +6,7 @@ USB_MANUFACTURER = "Adafruit Industries LLC"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
+CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
diff --git a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h
index 8510a7dae..f65ea8db7 100644
--- a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h
+++ b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h
@@ -41,6 +41,3 @@
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
-
-#define CIRCUITPY_I2CSLAVE
-#define CIRCUITPY_DISPLAYIO (1)
diff --git a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk
index 3f2cb6ce4..4fddcffc1 100644
--- a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk
@@ -10,8 +10,11 @@ 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
-MICROPY_PY_NETWORK = 1
+CIRCUITPY_NETWORK = 1
MICROPY_PY_WIZNET5K = 5500
diff --git a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk
index 634a9ede7..d9350ea22 100755
--- a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk
@@ -9,5 +9,10 @@ EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
LONGINT_IMPL = MPZ
+# No I2S on SAMR21G
+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 ddc4287c3..9f4a9fe83 100644
--- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk
@@ -6,6 +6,7 @@ USB_MANUFACTURER = "Adafruit Industries LLC"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
+CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21
diff --git a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.h
index 465c51b4a..bc8f5a134 100644
--- a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.h
+++ b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.h
@@ -44,7 +44,3 @@
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
-
-#define CIRCUITPY_I2CSLAVE
-#define CIRCUITPY_DISPLAYIO (1)
-#define CIRCUITPY_DISPLAY_LIMIT (3)
diff --git a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk
index bb8a2b0d9..63158681b 100644
--- a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk
@@ -10,5 +10,8 @@ EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, GD25Q64C"
LONGINT_IMPL = MPZ
+# No touch on SAMD51 yet
+CIRCUITPY_TOUCHIO = 0
+
CHIP_VARIANT = SAMD51P20A
CHIP_FAMILY = samd51
diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.h b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.h
index 1a570092b..4b5460706 100644
--- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.h
+++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.h
@@ -35,5 +35,3 @@
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
-
-#define CIRCUITPY_DISPLAYIO (1)
diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk
index 00e2dfa0d..e41e2ebd9 100644
--- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk
@@ -9,9 +9,6 @@ EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, GD25Q64C"
LONGINT_IMPL = MPZ
-# Disable pixelbuf to save room
-EXCLUDE_PIXELBUF = 1
-
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
diff --git a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk
index 2afff5965..d4d674d9d 100644
--- a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk
@@ -9,5 +9,10 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = GD25Q16C
LONGINT_IMPL = MPZ
+# No I2S on SAMD51G
+CIRCUITPY_AUDIOBUSIO = 0
+# No touch on SAMD51 yet
+CIRCUITPY_TOUCHIO = 0
+
CHIP_VARIANT = SAMD51G19A
CHIP_FAMILY = samd51
diff --git a/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk b/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk
index 31015ad17..a620f2919 100644
--- a/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk
@@ -6,6 +6,7 @@ USB_MANUFACTURER = "Electronic Cats"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
+CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
-CHIP_FAMILY = samd21 \ No newline at end of file
+CHIP_FAMILY = samd21
diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h
index 4835ee7d2..bfa254b95 100644
--- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h
+++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h
@@ -42,5 +42,3 @@
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
-
-#define CIRCUITPY_I2CSLAVE
diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk
index 49a94144b..1c5f4ff7d 100644
--- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk
@@ -5,14 +5,13 @@ USB_PRODUCT = "Metro M0 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"
SPI_FLASH_FILESYSTEM = 1
+EXTERNAL_FLASH_DEVICE_COUNT = 2
+EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
+
LONGINT_IMPL = MPZ
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
-MICROPY_PY_NETWORK = 1
+CIRCUITPY_NETWORK = 1
MICROPY_PY_WIZNET5K = 5500
-
-SPI_FLASH_FILESYSTEM = 1
-EXTERNAL_FLASH_DEVICE_COUNT = 2
-EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
diff --git a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.h
index 073468899..2a8878874 100644
--- a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.h
+++ b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.h
@@ -43,5 +43,3 @@
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
-
-#define CIRCUITPY_I2CSLAVE
diff --git a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk
index 633856362..35162b678 100644
--- a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk
@@ -10,8 +10,11 @@ EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C"
LONGINT_IMPL = MPZ
+# No touch on SAMD51 yet
+CIRCUITPY_TOUCHIO = 0
+
CHIP_VARIANT = SAMD51J19A
CHIP_FAMILY = samd51
-MICROPY_PY_NETWORK = 1
+CIRCUITPY_NETWORK = 1
MICROPY_PY_WIZNET5K = 5500
diff --git a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk
index a69d2f623..27bad2693 100644
--- a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk
@@ -7,7 +7,13 @@ USB_MANUFACTURER = "Benjamin Shockley"
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = "W25Q16JV_IM"
+
LONGINT_IMPL = MPZ
+# No I2S on SAMD51G
+CIRCUITPY_AUDIOBUSIO = 0
+# No touch on SAMD51 yet
+CIRCUITPY_TOUCHIO = 0
+
CHIP_VARIANT = SAMD51G19A
CHIP_FAMILY = samd51
diff --git a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.h b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.h
index cbbd4b569..a004336bf 100644
--- a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.h
+++ b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.h
@@ -12,9 +12,6 @@
#define CIRCUITPY_INTERNAL_NVM_SIZE 0
-// A number of modules are removed for pIRKey to make room for frozen libraries.
-#define PIRKEY_M0 (1)
-
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000)
#define IGNORE_PIN_PA02 1
diff --git a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk
index 69250626f..6b252e89b 100644
--- a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk
@@ -7,6 +7,17 @@ USB_MANUFACTURER = "Adafruit Industries LLC"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
+# A number of modules are removed for pIRKey to make room for frozen libraries.
+# Many I/O functions are not available.
+# math is very large and is also removed.
+CIRCUITPY_ANALOGIO = 0
+CIRCUITPY_MATH = 0
+CIRCUITPY_NEOPIXEL_WRITE = 0
+#CIRCUITPY_RTC = 0
+CIRCUITPY_SAMD = 0
+CIRCUITPY_USB_MIDI = 0
+CIRCUITPY_SMALL_BUILD = 1
+
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21
@@ -16,5 +27,3 @@ CFLAGS_INLINE_LIMIT = 45
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_IRRemote
-
-EXCLUDE_PIXELBUF = 1
diff --git a/ports/atmel-samd/boards/pyportal/mpconfigboard.h b/ports/atmel-samd/boards/pyportal/mpconfigboard.h
index f02d4a372..43346488b 100644
--- a/ports/atmel-samd/boards/pyportal/mpconfigboard.h
+++ b/ports/atmel-samd/boards/pyportal/mpconfigboard.h
@@ -38,5 +38,3 @@
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
-
-#define CIRCUITPY_DISPLAYIO (1)
diff --git a/ports/atmel-samd/boards/pyportal/mpconfigboard.mk b/ports/atmel-samd/boards/pyportal/mpconfigboard.mk
index aad81e94e..34a94ac2b 100644
--- a/ports/atmel-samd/boards/pyportal/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/pyportal/mpconfigboard.mk
@@ -10,5 +10,8 @@ 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/sam32/mpconfigboard.mk b/ports/atmel-samd/boards/sam32/mpconfigboard.mk
index 990676cb2..c41f45456 100644
--- a/ports/atmel-samd/boards/sam32/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/sam32/mpconfigboard.mk
@@ -8,5 +8,8 @@ QSPI_FLASH_FILESYSTEM = 0
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = MPZ
+# No touch on SAMD51 yet
+CIRCUITPY_TOUCHIO = 0
+
CHIP_VARIANT = SAMD51J20A
-CHIP_FAMILY = samd51 \ No newline at end of file
+CHIP_FAMILY = samd51
diff --git a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk
index ba9e9adfb..c0238ce80 100644
--- a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk
@@ -6,6 +6,7 @@ USB_MANUFACTURER = "SparkFun"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
+CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
diff --git a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk
index 0cba15d70..462e3e2ca 100644
--- a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk
@@ -6,6 +6,7 @@ USB_MANUFACTURER = "SparkFun"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
+CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
diff --git a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk
index 5c310cfda..93b07bc76 100644
--- a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk
@@ -9,5 +9,10 @@ EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, GD25Q64C"
LONGINT_IMPL = MPZ
+# No I2S on SAMD51G
+CIRCUITPY_AUDIOBUSIO = 0
+# No touch on SAMD51 yet
+CIRCUITPY_TOUCHIO = 0
+
CHIP_VARIANT = SAMD51G19A
CHIP_FAMILY = samd51
diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk
index 9b93719ef..1c6f6db05 100644
--- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk
@@ -6,8 +6,7 @@ USB_MANUFACTURER = "Adafruit Industries LLC"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
+CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21
-
-EXCLUDE_PIXELBUF = 1
diff --git a/ports/atmel-samd/common-hal/busio/I2C.c b/ports/atmel-samd/common-hal/busio/I2C.c
index dac15bcc1..a0c04d65d 100644
--- a/ports/atmel-samd/common-hal/busio/I2C.c
+++ b/ports/atmel-samd/common-hal/busio/I2C.c
@@ -67,10 +67,6 @@ Sercom *samd_i2c_get_sercom(const mcu_pin_obj_t* scl, const mcu_pin_obj_t* sda,
void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
const mcu_pin_obj_t* scl, const mcu_pin_obj_t* sda, uint32_t frequency, uint32_t timeout) {
- #ifdef PIRKEY_M0
- mp_raise_NotImplementedError(translate("Not enough pins available"));
- return;
- #endif
uint8_t sercom_index;
uint32_t sda_pinmux, scl_pinmux;
Sercom* sercom = samd_i2c_get_sercom(scl, sda, &sercom_index, &sda_pinmux, &scl_pinmux);
diff --git a/ports/atmel-samd/fatfs_port.c b/ports/atmel-samd/fatfs_port.c
index 67c6c9d35..c4ce18c2a 100644
--- a/ports/atmel-samd/fatfs_port.c
+++ b/ports/atmel-samd/fatfs_port.c
@@ -29,12 +29,20 @@
#include "lib/oofatfs/ff.h" /* FatFs lower layer API */
#include "lib/oofatfs/diskio.h" /* FatFs lower layer API */
#include "lib/timeutils/timeutils.h"
+
+#if CIRCUITPY_RTC
#include "shared-bindings/rtc/RTC.h"
+#endif
DWORD get_fattime(void) {
+#if CIRCUITPY_RTC
timeutils_struct_time_t tm;
common_hal_rtc_get_time(&tm);
-
return ((tm.tm_year - 1980) << 25) | (tm.tm_mon << 21) | (tm.tm_mday << 16) |
(tm.tm_hour << 11) | (tm.tm_min << 5) | (tm.tm_sec >> 1);
+#else
+ return ((2016 - 1980) << 25) | ((9) << 21) | ((1) << 16) | ((16) << 11) | ((43) << 5) | (35 / 2);
+#endif
+
+
}
diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h
index 8fdf916c3..0b62baa5a 100644
--- a/ports/atmel-samd/mpconfigport.h
+++ b/ports/atmel-samd/mpconfigport.h
@@ -1,169 +1,51 @@
-#include <stdint.h>
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2019 Dan Halbert for Adafruit Industries
+ *
+ * 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 __INCLUDED_MPCONFIGPORT_H
#define __INCLUDED_MPCONFIGPORT_H
-#define MICROPY_OBJ_REPR (MICROPY_OBJ_REPR_C)
-
-// options to control how MicroPython is built
-#define MICROPY_QSTR_BYTES_IN_HASH (1)
-#define MICROPY_ALLOC_PATH_MAX (256)
-#define MICROPY_ALLOC_PARSE_CHUNK_INIT (16)
-// TODO(tannewt): Reduce this number if we want the REPL to function under 512
-// free bytes.
-// #define MICROPY_ALLOC_PARSE_RULE_INIT (64)
-#define MICROPY_CAN_OVERRIDE_BUILTINS (1)
-#define MICROPY_EMIT_X64 (0)
-#define MICROPY_EMIT_THUMB (0)
-#define MICROPY_EMIT_INLINE_THUMB (0)
-#define MICROPY_COMP_MODULE_CONST (1)
-#define MICROPY_COMP_CONST (1)
-#define MICROPY_COMP_DOUBLE_TUPLE_ASSIGN (1)
-#define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (1)
-#define MICROPY_MEM_STATS (0)
-#define MICROPY_DEBUG_PRINTERS (0)
-#define MICROPY_ENABLE_GC (1)
-#define MICROPY_GC_ALLOC_THRESHOLD (0)
-#define MICROPY_REPL_EVENT_DRIVEN (0)
-#define MICROPY_HELPER_REPL (1)
-#define MICROPY_HELPER_LEXER_UNIX (0)
-#define MICROPY_ENABLE_SOURCE_LINE (1)
-#define MICROPY_ENABLE_DOC_STRING (0)
-//#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE)
-#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_NORMAL)
-#define MICROPY_PY_ASYNC_AWAIT (0)
-#define MICROPY_PY_BUILTINS_BYTEARRAY (1)
-#define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
-#define MICROPY_PY_BUILTINS_ENUMERATE (1)
-#define MICROPY_PY_BUILTINS_HELP (1)
-#define MICROPY_PY_BUILTINS_HELP_MODULES (1)
-#define MICROPY_PY_BUILTINS_INPUT (1)
-#define MICROPY_PY_BUILTINS_FILTER (1)
-#define MICROPY_PY_BUILTINS_SET (1)
-#define MICROPY_PY_BUILTINS_SLICE (1)
-#define MICROPY_PY_BUILTINS_SLICE_ATTRS (1)
-#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)
-#define MICROPY_NONSTANDARD_TYPECODES (0)
-#define MICROPY_PY_BUILTINS_PROPERTY (1)
-#define MICROPY_PY_BUILTINS_MIN_MAX (1)
-#define MICROPY_PY___FILE__ (1)
-#define MICROPY_PY_GC (1)
-#define MICROPY_PY_ARRAY (1)
-#define MICROPY_PY_ATTRTUPLE (1)
-#define MICROPY_PY_COLLECTIONS (1)
-#define MICROPY_PY_DESCRIPTORS (1)
-#define MICROPY_PY_MATH (0)
-#define MICROPY_PY_CMATH (0)
-#define MICROPY_PY_MICROPYTHON_MEM_INFO (0)
-#define MICROPY_PY_URANDOM (0)
-#define MICROPY_PY_URANDOM_EXTRA_FUNCS (0)
-#define MICROPY_PY_STRUCT (0)
-#define MICROPY_PY_SYS (1)
-#define MICROPY_PY_SYS_MAXSIZE (1)
-#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
-#define MICROPY_FLOAT_HIGH_QUALITY_HASH (1)
-#define MICROPY_STREAMS_NON_BLOCK (1)
-
-#ifndef MICROPY_PY_NETWORK
-#define MICROPY_PY_NETWORK (0)
-#endif
-
-#ifndef MICROPY_PY_WIZNET5K
-#define MICROPY_PY_WIZNET5K (0)
-#endif
-
-#ifndef MICROPY_PY_CC3K
-#define MICROPY_PY_CC3K (0)
-#endif
-
-// fatfs configuration used in ffconf.h
-#define MICROPY_FATFS_ENABLE_LFN (1)
-#define MICROPY_FATFS_LFN_CODE_PAGE (437) /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */
-#define MICROPY_FATFS_USE_LABEL (1)
-#define MICROPY_FATFS_RPATH (2)
-#define MICROPY_FATFS_VOLUMES (4)
-#define MICROPY_FATFS_MULTI_PARTITION (1)
-#define MICROPY_FATFS_NUM_PERSISTENT (1)
-// Only enable this if you really need it. It allocates a byte cache of this
-// size.
-// #define MICROPY_FATFS_MAX_SS (4096)
-
-#define FILESYSTEM_BLOCK_SIZE (512)
-
-#define MICROPY_VFS (1)
-#define MICROPY_VFS_FAT (1)
-#define MICROPY_PY_MACHINE (1)
-#define MICROPY_REPL_AUTO_INDENT (1)
-#define MICROPY_HW_ENABLE_DAC (1)
-#define MICROPY_ENABLE_FINALISER (1)
-#define MICROPY_USE_INTERNAL_PRINTF (1)
-#define MICROPY_PY_SYS_STDFILES (1)
-#define MICROPY_PY_IO_FILEIO (1)
-#define MICROPY_READER_VFS (1)
-#define MICROPY_PERSISTENT_CODE_LOAD (1)
-#define MICROPY_PY_BUILTINS_STR_UNICODE (1)
-
-#define MICROPY_KBD_EXCEPTION (1)
-
-// type definitions for the specific machine
-
-#define BYTES_PER_WORD (4)
-
-#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void*)((mp_uint_t)(p) | 1))
-
-#define MICROPY_STACK_CHECK (1)
-
-// Track stack usage on a debug build. Expose results via ustack module.
-#ifdef MICROPY_DEBUG_MODULES
-#define MICROPY_MAX_STACK_USAGE (1)
-#endif
-
-// This port is intended to be 32-bit, but unfortunately, int32_t for
-// different targets may be defined in different ways - either as int
-// or as long. This requires different printf formatting specifiers
-// to print such value. So, we avoid int32_t and use int directly.
-#define UINT_FMT "%u"
-#define INT_FMT "%d"
-typedef int mp_int_t; // must be pointer size
-typedef unsigned mp_uint_t; // must be pointer size
-
-typedef long mp_off_t;
-
-// XXX check we don't need this
-#define MICROPY_THREAD_YIELD()
-
-#define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len)
-
-#define mp_type_fileio mp_type_vfs_fat_fileio
-#define mp_type_textio mp_type_vfs_fat_textio
-
-#define mp_import_stat mp_vfs_import_stat
-#define mp_builtin_open_obj mp_vfs_open_obj
-
-// extra built in names to add to the global namespace
-#define MICROPY_PORT_BUILTINS \
- { MP_OBJ_NEW_QSTR(MP_QSTR_help), (mp_obj_t)&mp_builtin_help_obj }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
-
-// board specific definitions
-#include "mpconfigboard.h"
+// Definitions for which SAMD chip we're using.
#include "include/sam.h"
#ifdef SAMD21
#define CIRCUITPY_MCU_FAMILY samd21
#define MICROPY_PY_SYS_PLATFORM "Atmel SAMD21"
-#define PORT_HEAP_SIZE (16384 + 4096)
#define SPI_FLASH_MAX_BAUDRATE 8000000
#define CIRCUITPY_DEFAULT_STACK_SIZE 4096
+
+#define CIRCUITPY_I2C_SLAVE (0)
+
#define MICROPY_CPYTHON_COMPAT (0)
-#define MICROPY_MODULE_WEAK_LINKS (0)
#define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (0)
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (0)
#define MICROPY_PY_FUNCTION_ATTRS (0)
+// MICROPY_PY_UJSON depends on MICROPY_PY_IO
#define MICROPY_PY_IO (0)
+#define MICROPY_PY_UJSON (0)
#define MICROPY_PY_REVERSE_SPECIAL_METHODS (0)
-#define MICROPY_PY_SYS_EXC_INFO (0)
#define MICROPY_PY_UERRNO_LIST \
X(EPERM) \
X(ENOENT) \
@@ -181,302 +63,29 @@ typedef long mp_off_t;
#ifdef SAMD51
#define CIRCUITPY_MCU_FAMILY samd51
#define MICROPY_PY_SYS_PLATFORM "MicroChip SAMD51"
-#define PORT_HEAP_SIZE (0x20000) // 128KiB
#define SPI_FLASH_MAX_BAUDRATE 24000000
+// 24kiB stack
#define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000
#define MICROPY_CPYTHON_COMPAT (1)
-#define MICROPY_MODULE_WEAK_LINKS (1)
#define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (1)
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1)
#define MICROPY_PY_FUNCTION_ATTRS (1)
#define MICROPY_PY_IO (1)
+#define MICROPY_PY_UJSON (1)
#define MICROPY_PY_REVERSE_SPECIAL_METHODS (1)
-#define MICROPY_PY_SYS_EXC_INFO (1)
// MICROPY_PY_UERRNO_LIST - Use the default
#endif
-#ifdef LONGINT_IMPL_NONE
-#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_NONE)
-#endif
-
-#ifdef LONGINT_IMPL_MPZ
-#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
-#define MP_SSIZE_MAX (0x7fffffff)
-#endif
-
-#ifdef LONGINT_IMPL_LONGLONG
-#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_LONGLONG)
-#endif
-
-// extra built in modules to add to the list of known ones
-extern const struct _mp_obj_module_t microcontroller_module;
-extern const struct _mp_obj_module_t bitbangio_module;
-extern const struct _mp_obj_module_t audioio_module;
-extern const struct _mp_obj_module_t audiobusio_module;
-extern const struct _mp_obj_module_t analogio_module;
-extern const struct _mp_obj_module_t digitalio_module;
-extern const struct _mp_obj_module_t displayio_module;
-extern const struct _mp_obj_module_t pulseio_module;
-extern const struct _mp_obj_module_t busio_module;
-extern const struct _mp_obj_module_t board_module;
-extern const struct _mp_obj_module_t i2cslave_module;
-extern const struct _mp_obj_module_t math_module;
-extern const struct _mp_obj_module_t os_module;
-extern const struct _mp_obj_module_t random_module;
-extern const struct _mp_obj_module_t rotaryio_module;
-extern const struct _mp_obj_module_t rtc_module;
-extern const struct _mp_obj_module_t samd_module;
-extern const struct _mp_obj_module_t storage_module;
-extern const struct _mp_obj_module_t struct_module;
-extern const struct _mp_obj_module_t time_module;
-extern const struct _mp_obj_module_t cpy_nvm_module;
-extern const struct _mp_obj_module_t neopixel_write_module;
-extern const struct _mp_obj_module_t uheap_module;
-extern const struct _mp_obj_module_t ustack_module;
-extern const struct _mp_obj_module_t supervisor_module;
-extern const struct _mp_obj_module_t gamepad_module;
-extern const struct _mp_obj_module_t stage_module;
-extern const struct _mp_obj_module_t terminalio_module;
-extern const struct _mp_obj_module_t touchio_module;
-extern const struct _mp_obj_module_t usb_hid_module;
-extern const struct _mp_obj_module_t usb_midi_module;
-extern const struct _mp_obj_module_t network_module;
-extern const struct _mp_obj_module_t socket_module;
-extern const struct _mp_obj_module_t wiznet_module;
-#ifndef EXCLUDE_PIXELBUF
-extern const struct _mp_obj_module_t pixelbuf_module;
-#endif
-
-// Internal flash size dependent settings.
-#if BOARD_FLASH_SIZE > 192000
- #define MICROPY_PY_BUILTINS_STR_CENTER (1)
- #define MICROPY_PY_BUILTINS_STR_PARTITION (1)
- #define MICROPY_PY_BUILTINS_FROZENSET (1)
- #define MICROPY_PY_BUILTINS_STR_SPLITLINES (1)
- #define MICROPY_PY_BUILTINS_REVERSED (1)
- #define MICROPY_PY_UERRNO (1)
- #define MICROPY_PY_UERRNO_ERRORCODE (0)
- #define MICROPY_PY_URE (1)
- #define MICROPY_PY_URE_MATCH_GROUPS (1)
- #define MICROPY_PY_URE_MATCH_SPAN_START_END (1)
- #define MICROPY_PY_URE_SUB (1)
- #ifndef MICROPY_PY_FRAMEBUF
- #define MICROPY_PY_FRAMEBUF (0)
- #endif
-
- #define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (1)
- #define MICROPY_PY_ALL_SPECIAL_METHODS (1)
- // Scan gamepad every 32ms
- #define CIRCUITPY_GAMEPAD_TICKS 0x1f
-
- #if defined(__SAMD51G19A__) || defined(__SAMD51G18A__) || defined(__SAMR21G18A__)
- #define AUDIOBUSIO_MODULE
- #else
- #define AUDIOBUSIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_audiobusio), (mp_obj_t)&audiobusio_module },
- #endif
-
- #if defined(__SAMR21G18A__)
- #define AUDIOIO_MODULE
- #else
- #define AUDIOIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_audioio), (mp_obj_t)&audioio_module },
- #endif
-
- #ifdef CIRCUITPY_I2CSLAVE
- #define I2CSLAVE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_i2cslave), (mp_obj_t)&i2cslave_module },
- #else
- #define I2CSLAVE_MODULE
- #endif
-
- #if !defined(CIRCUITPY_DISPLAYIO) || CIRCUITPY_DISPLAYIO
- #define CIRCUITPY_DISPLAYIO (1)
- #define CIRCUITPY_DISPLAY_LIMIT (3)
- #define DISPLAYIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_displayio), (mp_obj_t)&displayio_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_terminalio), (mp_obj_t)&terminalio_module },
- #else
- #define CIRCUITPY_DISPLAYIO (0)
- #define CIRCUITPY_DISPLAY_LIMIT (0)
- #define DISPLAYIO_MODULE
- #endif
-
- #if MICROPY_PY_NETWORK
- #define NETWORK_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_network), (mp_obj_t)&network_module },
- #define SOCKET_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_socket), (mp_obj_t)&socket_module },
- #if MICROPY_PY_WIZNET5K
- #define WIZNET_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_wiznet), (mp_obj_t)&wiznet_module },
- #else
- #define WIZNET_MODULE
- #endif
- #else
- #define NETWORK_MODULE
- #define SOCKET_MODULE
- #define WIZNET_MODULE
- #endif
-
- // (u)json depends, perhaps erroneously, on MICROPY_PY_IO
- #if MICROPY_PY_IO
- #define JSON_MODULE { MP_ROM_QSTR(MP_QSTR_json), MP_ROM_PTR(&mp_module_ujson) },
- #define MICROPY_PY_UJSON (1)
- #else
- #define JSON_MODULE
- #endif
-
- #ifndef EXCLUDE_PIXELBUF
- #define PIXELBUF_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__pixelbuf),(mp_obj_t)&pixelbuf_module }
- #else
- #define PIXELBUF_MODULE
- #endif
-
- #ifndef EXTRA_BUILTIN_MODULES
- #define EXTRA_BUILTIN_MODULES \
- AUDIOIO_MODULE \
- AUDIOBUSIO_MODULE \
- { MP_OBJ_NEW_QSTR(MP_QSTR_bitbangio), (mp_obj_t)&bitbangio_module }, \
- DISPLAYIO_MODULE \
- I2CSLAVE_MODULE \
- NETWORK_MODULE \
- SOCKET_MODULE \
- WIZNET_MODULE \
- JSON_MODULE \
- { MP_OBJ_NEW_QSTR(MP_QSTR_rotaryio), (mp_obj_t)&rotaryio_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_gamepad),(mp_obj_t)&gamepad_module }, \
- PIXELBUF_MODULE
- #endif
- #define EXPRESS_BOARD
-
-#else
- #define MICROPY_PY_BUILTINS_REVERSED (0)
- #define MICROPY_PY_FRAMEBUF (0)
- #ifndef EXTRA_BUILTIN_MODULES
- #define EXTRA_BUILTIN_MODULES
- #endif
-
- #define MICROPY_PY_BUILTINS_COMPLEX (0)
-
- #define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (0)
- #define CIRCUITPY_DISPLAYIO (0)
- #define CIRCUITPY_DISPLAY_LIMIT (0)
-#endif
-
-// Disabled for now.
-// { MP_OBJ_NEW_QSTR(MP_QSTR__stage), (mp_obj_t)&stage_module },
-
-#ifdef SAMD21
-#define TOUCHIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_touchio), (mp_obj_t)&touchio_module },
-#endif
-#ifdef SAMD51
-#define TOUCHIO_MODULE
-#endif
-
-// A pIRKey has minimal I/O needs. Remove unneeded modules to make room
-// for frozen modules. math is very large and is also removed.
-#ifdef PIRKEY_M0
-#define MICROPY_PORT_BUILTIN_MODULES \
- { MP_OBJ_NEW_QSTR(MP_QSTR_board), (mp_obj_t)&board_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_busio), (mp_obj_t)&busio_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_digitalio), (mp_obj_t)&digitalio_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_microcontroller), (mp_obj_t)&microcontroller_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_os), (mp_obj_t)&os_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_pulseio), (mp_obj_t)&pulseio_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_random), (mp_obj_t)&random_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_storage), (mp_obj_t)&storage_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_struct), (mp_obj_t)&struct_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_supervisor), (mp_obj_t)&supervisor_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&time_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_usb_hid),(mp_obj_t)&usb_hid_module },
-#elif MICROPY_MODULE_WEAK_LINKS
-#define MICROPY_PORT_BUILTIN_MODULES \
- { MP_OBJ_NEW_QSTR(MP_QSTR_analogio), (mp_obj_t)&analogio_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_board), (mp_obj_t)&board_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_busio), (mp_obj_t)&busio_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_digitalio), (mp_obj_t)&digitalio_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_microcontroller), (mp_obj_t)&microcontroller_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_neopixel_write),(mp_obj_t)&neopixel_write_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR__os), (mp_obj_t)&os_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_pulseio), (mp_obj_t)&pulseio_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_random), (mp_obj_t)&random_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_rtc), (mp_obj_t)&rtc_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_samd),(mp_obj_t)&samd_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_storage), (mp_obj_t)&storage_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_struct), (mp_obj_t)&struct_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_supervisor), (mp_obj_t)&supervisor_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_math), (mp_obj_t)&math_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR__time), (mp_obj_t)&time_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_usb_hid),(mp_obj_t)&usb_hid_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_usb_midi),(mp_obj_t)&usb_midi_module }, \
- TOUCHIO_MODULE \
- EXTRA_BUILTIN_MODULES
-
-#define MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS \
- { MP_ROM_QSTR(MP_QSTR_errno), MP_ROM_PTR(&mp_module_uerrno) }, \
- { MP_ROM_QSTR(MP_QSTR_io), MP_ROM_PTR(&mp_module_io) }, \
- { MP_ROM_QSTR(MP_QSTR_os), MP_ROM_PTR(&os_module) }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&time_module }, \
-
-#else
-#define MICROPY_PORT_BUILTIN_MODULES \
- { MP_OBJ_NEW_QSTR(MP_QSTR_analogio), (mp_obj_t)&analogio_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_board), (mp_obj_t)&board_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_busio), (mp_obj_t)&busio_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_digitalio), (mp_obj_t)&digitalio_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_microcontroller), (mp_obj_t)&microcontroller_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_neopixel_write),(mp_obj_t)&neopixel_write_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_os), (mp_obj_t)&os_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_pulseio), (mp_obj_t)&pulseio_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_random), (mp_obj_t)&random_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_rtc), (mp_obj_t)&rtc_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_storage), (mp_obj_t)&storage_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_struct), (mp_obj_t)&struct_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_supervisor), (mp_obj_t)&supervisor_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_math), (mp_obj_t)&math_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&time_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_usb_hid),(mp_obj_t)&usb_hid_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_usb_midi),(mp_obj_t)&usb_midi_module }, \
- TOUCHIO_MODULE \
- EXTRA_BUILTIN_MODULES
-#endif
-
-#define MICROPY_PORT_BUILTIN_DEBUG_MODULES \
- { MP_OBJ_NEW_QSTR(MP_QSTR_uheap),(mp_obj_t)&uheap_module }, \
- { MP_OBJ_NEW_QSTR(MP_QSTR_ustack),(mp_obj_t)&ustack_module }
-
-// We need to provide a declaration/definition of alloca()
-#include <alloca.h>
-
-#ifdef __linux__
-#define MICROPY_MIN_USE_STDOUT (1)
-#endif
-
-#ifdef __thumb__
-#define MICROPY_MIN_USE_CORTEX_CPU (1)
-#define MICROPY_MIN_USE_SAMD21_MCU (1)
-#endif
-
-#define MP_STATE_PORT MP_STATE_VM
+// Turning off audioio, audiobusio, and touchio as necessary
+// due to limitations of chips is handled in mpconfigboard.mk
#include "peripherals/samd/dma.h"
-#include "supervisor/flash_root_pointers.h"
-#if MICROPY_PY_NETWORK
- #define NETWORK_ROOT_POINTERS mp_obj_list_t mod_network_nic_list;
-#else
- #define NETWORK_ROOT_POINTERS
-#endif
-
#define MICROPY_PORT_ROOT_POINTERS \
- const char *readline_hist[8]; \
- vstr_t *repl_line; \
- mp_obj_t playing_audio[AUDIO_DMA_CHANNEL_COUNT]; \
- mp_obj_t rtc_time_source; \
- FLASH_ROOT_POINTERS \
- mp_obj_t gamepad_singleton; \
- mp_obj_t terminal_tilegrid_tiles; \
- NETWORK_ROOT_POINTERS \
-
-void run_background_tasks(void);
-#define MICROPY_VM_HOOK_LOOP run_background_tasks();
-#define MICROPY_VM_HOOK_RETURN run_background_tasks();
+ CIRCUITPY_COMMON_ROOT_POINTERS \
+ mp_obj_t playing_audio[AUDIO_DMA_CHANNEL_COUNT] \
+ ;
-#define CIRCUITPY_AUTORELOAD_DELAY_MS 500
-#define CIRCUITPY_BOOT_OUTPUT_FILE "/boot_out.txt"
+#include "py/circuitpy_mpconfig.h"
#endif // __INCLUDED_MPCONFIGPORT_H
diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c
index 3f73d9a8f..282cbf8ff 100644
--- a/ports/atmel-samd/supervisor/port.c
+++ b/ports/atmel-samd/supervisor/port.c
@@ -164,7 +164,7 @@ safe_mode_t port_init(void) {
// Configure millisecond timer initialization.
tick_init();
-#ifndef PIRKEY_M0
+#if CIRCUITPY_RTC
rtc_init();
#endif
@@ -209,9 +209,11 @@ void reset_port(void) {
pulseout_reset();
pwmout_reset();
-#ifndef PIRKEY_M0
+#if CIRCUITPY_ANALOGIO
analogin_reset();
analogout_reset();
+#endif
+#if CIRCUITPY_RTC
rtc_reset();
#endif
diff --git a/ports/esp8266/Makefile b/ports/esp8266/Makefile
index 6d63c0d1a..4f23dfff1 100644
--- a/ports/esp8266/Makefile
+++ b/ports/esp8266/Makefile
@@ -148,11 +148,6 @@ SRC_SHARED_MODULE = \
os/__init__.c \
random/__init__.c \
struct/__init__.c
-
-ifndef EXCLUDE_PIXELBUF
- SRC_SHARED_MODULE += _pixelbuf/__init__.c \
- _pixelbuf/PixelBuf.c
-endif
SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) \
$(addprefix shared-module/, $(SRC_SHARED_MODULE))
diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile
index ac7024e82..3681ac49e 100755
--- a/ports/nrf/Makefile
+++ b/ports/nrf/Makefile
@@ -1,3 +1,27 @@
+# This file is part of the MicroPython project, http://micropython.org/
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2019 Dan Halbert for Adafruit Industries
+#
+# 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.
+
# Select the board to build for.
ifeq ($(BOARD),)
$(info You must provide a BOARD parameter with 'BOARD=')
@@ -11,16 +35,29 @@ else
endif
CLI_SD := $(SD)
-
-include boards/$(BOARD)/mpconfigboard.mk
-
SD_LOWER = $(shell echo $(SD) | tr '[:upper:]' '[:lower:]')
# Build directory with SD if it's different from the default.
BUILD ?= $(if $(CLI_SD),build-$(BOARD)-$(SD_LOWER),build-$(BOARD))
include ../../py/mkenv.mk
--include mpconfigport.mk
+# Board-specific
+include boards/$(BOARD)/mpconfigboard.mk
+# Port-specific
+include mpconfigport.mk
+# CircuitPython-specific
+include $(TOP)/py/circuitpy_mpconfig.mk
+
+# qstr definitions (must come before including py.mk)
+QSTR_DEFS = qstrdefsport.h
+
+# include py core make definitions
+include $(TOP)/py/py.mk
+
+include $(TOP)/supervisor/supervisor.mk
+
+# Include make rules and variables common across CircuitPython builds.
+include $(TOP)/py/circuitpy_defns.mk
ifneq ($(SD), )
include bluetooth/bluetooth_common.mk
@@ -28,19 +65,10 @@ endif
FROZEN_MPY_DIR = freeze
-# include py core make definitions
-include ../../py/py.mk
-
-ifneq ($(MCU_SUB_VARIANT),nrf52840)
-USB = FALSE
-endif
-
-include $(TOP)/supervisor/supervisor.mk
+CROSS_COMPILE = arm-none-eabi-
FATFS_DIR = lib/oofatfs
-CROSS_COMPILE = arm-none-eabi-
-
INC += -I.
INC += -I../..
INC += -I$(BUILD)
@@ -59,43 +87,51 @@ INC += -I../../lib/mp-readline
INC += -I../../lib/tinyusb/src
INC += -I../../supervisor/shared/usb
-NRF_DEFINES += -DCONFIG_GPIO_AS_PINRESET
-
-CFLAGS += -mthumb -mabi=aapcs -fsingle-precision-constant -Wdouble-promotion
-CFLAGS += -mtune=cortex-m4 -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
-CFLAGS += $(INC) -Wall -Werror -ansi -std=gnu99 -nostdlib $(COPT) $(NRF_DEFINES) $(CFLAGS_MOD)
-CFLAGS += -fno-strict-aliasing
-CFLAGS += -fstack-usage -fno-builtin -fshort-enums
-CFLAGS += -fdata-sections -ffunction-sections
-CFLAGS += -D__START=main
-
-LDFLAGS = $(CFLAGS)
-LDFLAGS += -Xlinker -Map=$(@:.elf=.map)
-LDFLAGS += -mthumb -mabi=aapcs -T $(LD_FILE) -L boards/
-LDFLAGS += -Wl,--gc-sections
-
-# TinyUSB defines
-CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_NRF5X -DCFG_TUD_CDC_RX_BUFSIZE=1024 -DCFG_TUD_CDC_TX_BUFSIZE=1024 -DCFG_TUD_MSC_BUFSIZE=4096 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128
-
#Debugging/Optimization
ifeq ($(DEBUG), 1)
- #ASMFLAGS += -g -gtabs+
- CFLAGS += -O1 -ggdb
- LDFLAGS += -O1
+ CFLAGS += -ggdb
# You may want to enable these flags to make setting breakpoints easier.
CFLAGS += -fno-inline -fno-ipa-sra
else
CFLAGS += -Os -DNDEBUG
- LDFLAGS += -Os
+ # TODO: Test with -flto
+ ### CFLAGS += -flto
endif
-LIBM_FILE_NAME = $(shell $(CC) $(CFLAGS) -print-file-name=libm.a)
-LIBC_FILE_NAME = $(shell $(CC) $(CFLAGS) -print-file-name=libc.a)
-LIBGCC_FILE_NAME = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
-LIBS := -L $(dir $(LIBM_FILE_NAME)) -lm
-LIBS += -L $(dir $(LIBC_FILE_NAME)) -lc
-LIBS += -L $(dir $(LIBGCC_FILE_NAME)) -lgcc
+CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT)
+
+# Undo some warnings.
+# nrfx uses undefined preprocessor variables quite casually, so we can't do warning checks for these.
+CFLAGS += -Wno-undef
+# nrfx does casts that increase alignment requirements.
+CFLAGS += -Wno-cast-align
+
+NRF_DEFINES += -DCONFIG_GPIO_AS_PINRESET
+CFLAGS += $(NRF_DEFINES)
+
+CFLAGS += \
+ -mthumb \
+ -mabi=aapcs-linux \
+ -mfloat-abi=hard \
+ -mcpu=cortex-m4 \
+ -mfpu=fpv4-sp-d16
+
+# TODO: check this
+CFLAGS += -D__START=main
+
+LDFLAGS = $(CFLAGS) -nostartfiles -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs
+LIBS := -lgcc -lc
+
+LDFLAGS += -mthumb -mcpu=cortex-m4
+
+# Use toolchain libm if we're not using our own.
+ifndef INTERNAL_LIBM
+LIBS += -lm
+endif
+
+# TinyUSB defines
+CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_NRF5X -DCFG_TUD_CDC_RX_BUFSIZE=1024 -DCFG_TUD_CDC_TX_BUFSIZE=1024 -DCFG_TUD_MSC_BUFSIZE=4096 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128
SRC_NRFX = $(addprefix nrfx/,\
drivers/src/nrfx_power.c \
@@ -144,117 +180,11 @@ SRC_C += \
sd_mutex.c \
supervisor/shared/memory.c
-
-SRC_COMMON_HAL += \
- analogio/AnalogIn.c \
- analogio/AnalogOut.c \
- analogio/__init__.c \
- board/__init__.c \
- busio/I2C.c \
- busio/SPI.c \
- busio/UART.c \
- busio/__init__.c\
- digitalio/DigitalInOut.c \
- digitalio/__init__.c \
- displayio/ParallelBus.c \
- microcontroller/Pin.c \
- microcontroller/Processor.c \
- microcontroller/__init__.c \
- neopixel_write/__init__.c \
- os/__init__.c \
- pulseio/PWMOut.c \
- pulseio/PulseIn.c \
- pulseio/PulseOut.c \
- pulseio/__init__.c \
- rotaryio/__init__.c \
- rotaryio/IncrementalEncoder.c \
- supervisor/Runtime.c \
- supervisor/__init__.c \
- time/__init__.c \
- touchio/__init__.c \
- touchio/TouchIn.c \
-
-ifneq ($(SD), )
-SRC_COMMON_HAL += \
- bleio/__init__.c \
- bleio/Adapter.c \
- bleio/Broadcaster.c \
- bleio/Characteristic.c \
- bleio/CharacteristicBuffer.c \
- bleio/Descriptor.c \
- bleio/Peripheral.c \
- bleio/Scanner.c \
- bleio/Service.c \
- bleio/UUID.c
-endif
-
-# These don't have corresponding files in each port but are still located in
-# shared-bindings to make it clear what the contents of the modules are.
-SRC_BINDINGS_ENUMS = \
- busio/OneWire.c \
- digitalio/Direction.c \
- digitalio/DriveMode.c \
- digitalio/Pull.c \
- displayio/Glyph.c \
- microcontroller/RunMode.c \
- help.c \
- math/__init__.c \
- util.c
-
-ifneq ($(SD), )
-SRC_BINDINGS_ENUMS += \
- bleio/Address.c \
- bleio/AddressType.c \
- bleio/AdvertisementData.c \
- bleio/ScanEntry.c
-endif
-
-SRC_SHARED_MODULE = \
- os/__init__.c \
- random/__init__.c \
- struct/__init__.c \
- gamepad/__init__.c \
- gamepad/GamePad.c \
- bitbangio/__init__.c \
- bitbangio/I2C.c \
- bitbangio/OneWire.c \
- bitbangio/SPI.c \
- busio/OneWire.c \
- displayio/__init__.c \
- displayio/Bitmap.c \
- displayio/BuiltinFont.c \
- displayio/ColorConverter.c \
- displayio/Display.c \
- displayio/FourWire.c \
- displayio/Group.c \
- displayio/OnDiskBitmap.c \
- displayio/Palette.c \
- displayio/Shape.c \
- displayio/TileGrid.c \
- storage/__init__.c \
- terminalio/__init__.c \
- terminalio/Terminal.c
-
-
-ifndef EXCLUDE_PIXELBUF
- SRC_SHARED_MODULE += _pixelbuf/__init__.c \
- _pixelbuf/PixelBuf.c
-endif
-
-# uheap/__init__.c \
- ustack/__init__.c
-
# USB source files for nrf52840
ifeq ($(MCU_SUB_VARIANT),nrf52840)
-
SRC_C += \
lib/tinyusb/src/portable/nordic/nrf5x/dcd_nrf5x.c \
lib/tinyusb/src/portable/nordic/nrf5x/hal_nrf5x.c
-
-SRC_SHARED_MODULE += \
- usb_hid/__init__.c \
- usb_hid/Device.c \
-
endif
SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \
@@ -271,36 +201,44 @@ FROZEN_MPY_MPY_FILES := $(addprefix $(BUILD)/,$(FROZEN_MPY_PY_FILES:.py=.mpy))
OBJ += $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(SRC_NRFX:.c=.o))
-OBJ += $(addprefix $(BUILD)/, $(DRIVERS_SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_EXPANDED:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(SRC_SHARED_MODULE_EXPANDED:.c=.o))
+ifeq ($(INTERNAL_LIBM),1)
+OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o))
+endif
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
$(BUILD)/$(FATFS_DIR)/ff.o: COPT += -Os
$(filter $(PY_BUILD)/../extmod/vfs_fat_%.o, $(PY_O)): COPT += -Os
-.phony: all flash sd binary hex
+# List of sources for qstr extraction
+SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_MOD) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED)
+# Sources that only hold QSTRs after pre-processing.
+SRC_QSTR_PREPROCESSOR +=
+
-all: binary hex uf2
+all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2
-OUTPUT_FILENAME = firmware
+$(BUILD)/firmware.elf: $(OBJ)
+ $(STEPECHO) "LINK $@"
+ $(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(LIBS) -Wl,--end-group
+ $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(LD_FILE)
-## Create binary .bin file from the .out file
-binary: $(BUILD)/$(OUTPUT_FILENAME).bin
+$(BUILD)/firmware.bin: $(BUILD)/firmware.elf
+ $(STEPECHO) "Create $@"
+ $(Q)$(OBJCOPY) -O binary $^ $@
+# $(Q)$(OBJCOPY) -O binary -j .vectors -j .text -j .data $^ $@
-$(BUILD)/$(OUTPUT_FILENAME).bin: $(BUILD)/$(OUTPUT_FILENAME).elf
- $(OBJCOPY) -O binary $< $@
+$(BUILD)/firmware.hex: $(BUILD)/firmware.elf
+ $(STEPECHO) "Create $@"
+ $(Q)$(OBJCOPY) -O ihex $^ $@
+# $(Q)$(OBJCOPY) -O ihex -j .vectors -j .text -j .data $^ $@
-## Create binary .hex file from the .out file
-hex: $(BUILD)/$(OUTPUT_FILENAME).hex
+$(BUILD)/firmware.uf2: $(BUILD)/firmware.hex
+ $(ECHO) "Create $@"
+ $(PYTHON3) $(TOP)/tools/uf2/utils/uf2conv.py -f 0xADA52840 -c -o "$(BUILD)/firmware.uf2" $^
-$(BUILD)/$(OUTPUT_FILENAME).hex: $(BUILD)/$(OUTPUT_FILENAME).elf
- $(OBJCOPY) -O ihex $< $@
-## Create uf2 file
-uf2: $(BUILD)/$(OUTPUT_FILENAME).hex
- $(ECHO) "Create $(OUTPUT_FILENAME).uf2"
- $(PYTHON2) $(TOP)/tools/uf2/utils/uf2conv.py -f 0xADA52840 -c -o "$(BUILD)/$(OUTPUT_FILENAME).uf2" $^
#####################
# Flash with debugger
@@ -310,13 +248,13 @@ FLASHER ?=
ifeq ($(FLASHER),)
# Also update to bootloader settting to validate application and skip checksum ( app valid = 0x0001, crc = 0x0000 )
-flash: $(BUILD)/$(OUTPUT_FILENAME).hex
+flash: $(BUILD)/firmware.hex
nrfjprog --program $< --sectorerase -f $(MCU_VARIANT)
nrfjprog --erasepage $(BOOT_SETTING_ADDR) -f $(MCU_VARIANT)
nrfjprog --memwr $(BOOT_SETTING_ADDR) --val 0x00000001 -f $(MCU_VARIANT)
nrfjprog --reset -f $(MCU_VARIANT)
-sd: $(BUILD)/$(OUTPUT_FILENAME).hex
+sd: $(BUILD)/firmware.hex
nrfjprog --eraseall -f $(MCU_VARIANT)
nrfjprog --program $(SOFTDEV_HEX) -f $(MCU_VARIANT)
nrfjprog --program $< --sectorerase -f $(MCU_VARIANT)
@@ -324,13 +262,13 @@ sd: $(BUILD)/$(OUTPUT_FILENAME).hex
else ifeq ($(FLASHER), pyocd)
-flash: $(BUILD)/$(OUTPUT_FILENAME).hex
+flash: $(BUILD)/firmware.hex
pyocd-flashtool -t $(MCU_VARIANT) $< --sector_erase
#pyocd-tool -t $(MCU_VARIANT) erase $(BOOT_SETTING_ADDR)
pyocd-tool -t $(MCU_VARIANT) write32 $(BOOT_SETTING_ADDR) 0x00000001
pyocd-tool -t $(MCU_VARIANT) reset
-sd: $(BUILD)/$(OUTPUT_FILENAME).hex
+sd: $(BUILD)/firmware.hex
pyocd-flashtool -t $(MCU_VARIANT) --chip_erase
pyocd-flashtool -t $(MCU_VARIANT) $(SOFTDEV_HEX)
pyocd-flashtool -t $(MCU_VARIANT) $< --sector_erase
@@ -366,36 +304,13 @@ dfu-flash: $(BUILD)/dfu-package.zip
## Create DFU package file
dfu-gen: $(BUILD)/dfu-package.zip
-$(BUILD)/dfu-package.zip: $(BUILD)/$(OUTPUT_FILENAME).hex
+$(BUILD)/dfu-package.zip: $(BUILD)/firmware.hex
$(NRFUTIL) dfu genpkg --sd-req 0xFFFE --dev-type 0x0052 --application $^ $(BUILD)/dfu-package.zip
-# You must have $^ here because it deduplicates entries in $(OBJ)
-$(BUILD)/$(OUTPUT_FILENAME).elf: $(OBJ)
- $(ECHO) "LINK $@"
- $(Q)$(CC) $(LDFLAGS) -o $@ $^ -Wl,--start-group $(LIBS) -Wl,--end-group
- $(Q)$(SIZE) $@
-
-# List of sources for qstr extraction
-SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_MOD) $(DRIVERS_SRC_C) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED)
-
-# Append any auto-generated sources that are needed by sources listed in
-# SRC_QSTR
-SRC_QSTR_AUTO_DEPS +=
-
-AF_FILE = $(MCU_VARIANT)_af.csv
-PREFIX_FILE = boards/$(MCU_VARIANT)_prefix.c
-
-ifneq ($(FROZEN_DIR),)
-# To use frozen source modules, put your .py files in a subdirectory (eg scripts/)
-# and then invoke make with FROZEN_DIR=scripts (be sure to build from scratch).
-CFLAGS += -DMICROPY_MODULE_FROZEN_STR
-endif
-
-ifneq ($(FROZEN_MPY_DIR),)
-# To use frozen bytecode, put your .py files in a subdirectory (eg frozen/) and
-# then invoke make with FROZEN_MPY_DIR=frozen (be sure to build from scratch).
-CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
-CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
-endif
include $(TOP)/py/mkrules.mk
+
+# Print out the value of a make variable.
+# https://stackoverflow.com/questions/16467718/how-to-print-out-a-variable-in-makefile
+print-%:
+ @echo $* = $($*)
diff --git a/ports/nrf/bluetooth/ble_drv.c b/ports/nrf/bluetooth/ble_drv.c
index f80c7b1f0..4e7523691 100644
--- a/ports/nrf/bluetooth/ble_drv.c
+++ b/ports/nrf/bluetooth/ble_drv.c
@@ -87,6 +87,8 @@ void ble_drv_remove_event_handler(ble_drv_evt_handler_t func, void *param) {
}
}
+extern void tusb_hal_nrf_power_event (uint32_t event);
+
void SD_EVT_IRQHandler(void) {
uint32_t evt_id;
while (sd_evt_get(&evt_id) != NRF_ERROR_NOT_FOUND) {
@@ -101,7 +103,6 @@ void SD_EVT_IRQHandler(void) {
(evt_id == NRF_EVT_POWER_USB_POWER_READY) ? NRFX_POWER_USB_EVT_READY :
(evt_id == NRF_EVT_POWER_USB_REMOVED ) ? NRFX_POWER_USB_EVT_REMOVED : -1;
- extern void tusb_hal_nrf_power_event (uint32_t event);
tusb_hal_nrf_power_event(usbevt);
}
break;
diff --git a/ports/nrf/bluetooth/ble_drv.h b/ports/nrf/bluetooth/ble_drv.h
index 3d1f551c5..a6f7b9033 100644
--- a/ports/nrf/bluetooth/ble_drv.h
+++ b/ports/nrf/bluetooth/ble_drv.h
@@ -50,7 +50,7 @@
typedef void (*ble_drv_evt_handler_t)(ble_evt_t*, void*);
-void ble_drv_reset();
+void ble_drv_reset(void);
void ble_drv_add_event_handler(ble_drv_evt_handler_t func, void *param);
void ble_drv_remove_event_handler(ble_drv_evt_handler_t func, void *param);
diff --git a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h
index da72c085e..764decbca 100644
--- a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h
+++ b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h
@@ -55,9 +55,6 @@
#define CIRCUITPY_AUTORELOAD_DELAY_MS 500
-// If you change this, then make sure to update the linker scripts as well to
-// make sure you don't overwrite code
-#define PORT_HEAP_SIZE (128 * 1024)
// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE)
diff --git a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.mk b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.mk
index 905921a5d..0fef54ef7 100644
--- a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.mk
+++ b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.mk
@@ -16,6 +16,7 @@ ifeq ($(SD),)
LD_FILE = boards/nrf52840_1M_256k.ld
else
LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld
+ CIRCUITPY_BLEIO = 1
endif
NRF_DEFINES += -DNRF52840_XXAA -DNRF52840
diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.h b/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.h
index 40b6487ec..ed4836494 100644
--- a/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.h
+++ b/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.h
@@ -42,9 +42,6 @@
#define CIRCUITPY_AUTORELOAD_DELAY_MS 500
-// If you change this, then make sure to update the linker scripts as well to
-// make sure you don't overwrite code
-#define PORT_HEAP_SIZE (128 * 1024)
// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE)
diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk b/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk
index 84dff0bc4..abb0f4946 100644
--- a/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk
+++ b/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk
@@ -16,6 +16,7 @@ ifeq ($(SD),)
LD_FILE = boards/nrf52840_1M_256k.ld
else
LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld
+ CIRCUITPY_BLEIO = 1
endif
NRF_DEFINES += -DNRF52840_XXAA -DNRF52840
diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.h b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.h
index 8321abb96..e8830bb8d 100644
--- a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.h
+++ b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.h
@@ -35,9 +35,6 @@
#define CIRCUITPY_AUTORELOAD_DELAY_MS 500
-// If you change this, then make sure to update the linker scripts as well to
-// make sure you don't overwrite code
-#define PORT_HEAP_SIZE (128 * 1024)
// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE)
diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk
index 54fa0617b..82bbc3bd8 100644
--- a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk
+++ b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk
@@ -17,6 +17,7 @@ ifeq ($(SD),)
LD_FILE = boards/nrf52840_1M_256k.ld
else
LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld
+ CIRCUITPY_BLEIO = 1
endif
NRF_DEFINES += -DNRF52840_XXAA -DNRF52840
diff --git a/ports/nrf/boards/particle_argon/mpconfigboard.h b/ports/nrf/boards/particle_argon/mpconfigboard.h
index bd9a46349..902f0c2e7 100644
--- a/ports/nrf/boards/particle_argon/mpconfigboard.h
+++ b/ports/nrf/boards/particle_argon/mpconfigboard.h
@@ -57,9 +57,6 @@
#define CIRCUITPY_AUTORELOAD_DELAY_MS 500
-// If you change this, then make sure to update the linker scripts as well to
-// make sure you don't overwrite code
-#define PORT_HEAP_SIZE (128 * 1024)
// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE)
diff --git a/ports/nrf/boards/particle_argon/mpconfigboard.mk b/ports/nrf/boards/particle_argon/mpconfigboard.mk
index ee30c2be9..8d3bb2a28 100644
--- a/ports/nrf/boards/particle_argon/mpconfigboard.mk
+++ b/ports/nrf/boards/particle_argon/mpconfigboard.mk
@@ -16,6 +16,7 @@ ifeq ($(SD),)
LD_FILE = boards/nrf52840_1M_256k.ld
else
LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld
+ CIRCUITPY_BLEIO = 1
endif
NRF_DEFINES += -DNRF52840_XXAA -DNRF52840
diff --git a/ports/nrf/boards/particle_boron/mpconfigboard.h b/ports/nrf/boards/particle_boron/mpconfigboard.h
index ed675c811..1e9b78b45 100644
--- a/ports/nrf/boards/particle_boron/mpconfigboard.h
+++ b/ports/nrf/boards/particle_boron/mpconfigboard.h
@@ -57,9 +57,6 @@
#define CIRCUITPY_AUTORELOAD_DELAY_MS 500
-// If you change this, then make sure to update the linker scripts as well to
-// make sure you don't overwrite code
-#define PORT_HEAP_SIZE (128 * 1024)
// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE)
diff --git a/ports/nrf/boards/particle_boron/mpconfigboard.mk b/ports/nrf/boards/particle_boron/mpconfigboard.mk
index ba6c57b85..801b9613f 100644
--- a/ports/nrf/boards/particle_boron/mpconfigboard.mk
+++ b/ports/nrf/boards/particle_boron/mpconfigboard.mk
@@ -16,6 +16,7 @@ ifeq ($(SD),)
LD_FILE = boards/nrf52840_1M_256k.ld
else
LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld
+ CIRCUITPY_BLEIO = 1
endif
NRF_DEFINES += -DNRF52840_XXAA -DNRF52840
diff --git a/ports/nrf/boards/particle_xenon/mpconfigboard.h b/ports/nrf/boards/particle_xenon/mpconfigboard.h
index 0b119b8bf..7c0f238a3 100644
--- a/ports/nrf/boards/particle_xenon/mpconfigboard.h
+++ b/ports/nrf/boards/particle_xenon/mpconfigboard.h
@@ -57,9 +57,6 @@
#define CIRCUITPY_AUTORELOAD_DELAY_MS 500
-// If you change this, then make sure to update the linker scripts as well to
-// make sure you don't overwrite code
-#define PORT_HEAP_SIZE (128 * 1024)
// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE)
diff --git a/ports/nrf/boards/particle_xenon/mpconfigboard.mk b/ports/nrf/boards/particle_xenon/mpconfigboard.mk
index 5ed0677c7..5cebc423a 100644
--- a/ports/nrf/boards/particle_xenon/mpconfigboard.mk
+++ b/ports/nrf/boards/particle_xenon/mpconfigboard.mk
@@ -16,6 +16,7 @@ ifeq ($(SD),)
LD_FILE = boards/nrf52840_1M_256k.ld
else
LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld
+ CIRCUITPY_BLEIO = 1
endif
NRF_DEFINES += -DNRF52840_XXAA -DNRF52840
diff --git a/ports/nrf/boards/pca10056/mpconfigboard.h b/ports/nrf/boards/pca10056/mpconfigboard.h
index 8d420721f..c083b329d 100644
--- a/ports/nrf/boards/pca10056/mpconfigboard.h
+++ b/ports/nrf/boards/pca10056/mpconfigboard.h
@@ -30,7 +30,6 @@
#define MICROPY_HW_MCU_NAME "nRF52840"
#define MICROPY_PY_SYS_PLATFORM "nRF52840-DK"
-#define PORT_HEAP_SIZE (128 * 1024)
#define CIRCUITPY_AUTORELOAD_DELAY_MS 500
#define MICROPY_HW_LED_STATUS (&pin_P0_13)
diff --git a/ports/nrf/boards/pca10056/mpconfigboard.mk b/ports/nrf/boards/pca10056/mpconfigboard.mk
index 49c708cff..723e7976e 100644
--- a/ports/nrf/boards/pca10056/mpconfigboard.mk
+++ b/ports/nrf/boards/pca10056/mpconfigboard.mk
@@ -16,6 +16,7 @@ ifeq ($(SD),)
LD_FILE = boards/nrf52840_1M_256k.ld
else
LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld
+ CIRCUITPY_BLEIO = 1
endif
NRF_DEFINES += -DNRF52840_XXAA -DNRF52840
diff --git a/ports/nrf/boards/pca10059/mpconfigboard.h b/ports/nrf/boards/pca10059/mpconfigboard.h
index 03abd65e8..d5ce21229 100644
--- a/ports/nrf/boards/pca10059/mpconfigboard.h
+++ b/ports/nrf/boards/pca10059/mpconfigboard.h
@@ -30,5 +30,4 @@
#define MICROPY_HW_LED_STATUS (&pin_P0_06)
-#define PORT_HEAP_SIZE (128 * 1024)
#define CIRCUITPY_AUTORELOAD_DELAY_MS 500
diff --git a/ports/nrf/boards/pca10059/mpconfigboard.mk b/ports/nrf/boards/pca10059/mpconfigboard.mk
index 030c9a823..db9d80668 100644
--- a/ports/nrf/boards/pca10059/mpconfigboard.mk
+++ b/ports/nrf/boards/pca10059/mpconfigboard.mk
@@ -17,6 +17,7 @@ ifeq ($(SD),)
LD_FILE = boards/nrf52840_1M_256k.ld
else
LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld
+ CIRCUITPY_BLEIO = 1
endif
NRF_DEFINES += -DNRF52840_XXAA -DNRF52840
diff --git a/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.h b/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.h
index 353a0ad8f..3c13a4ad5 100644
--- a/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.h
+++ b/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.h
@@ -30,7 +30,6 @@
#define MICROPY_HW_MCU_NAME "nRF52840"
#define MICROPY_PY_SYS_PLATFORM "SFE_NRF52840_Mini"
-#define PORT_HEAP_SIZE (128 * 1024)
#define CIRCUITPY_AUTORELOAD_DELAY_MS 500
#define DEFAULT_I2C_BUS_SCL (&pin_P0_11)
@@ -65,4 +64,3 @@
#define SPI_FLASH_SCK_PIN &pin_P0_19
#define SPI_FLASH_CS_PIN &pin_P0_17
#endif*/
-
diff --git a/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk b/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk
index d4819c855..73b9ad767 100644
--- a/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk
+++ b/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk
@@ -16,10 +16,11 @@ ifeq ($(SD),)
LD_FILE = boards/nrf52840_1M_256k.ld
else
LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld
+ CIRCUITPY_BLEIO = 1
endif
NRF_DEFINES += -DNRF52840_XXAA -DNRF52840
-QSPI_FLASH_FILESYSTEM = 0
-EXTERNAL_FLASH_DEVICE_COUNT = 0
-EXTERNAL_FLASH_DEVICES =
+QSPI_FLASH_FILESYSTEM = 0
+EXTERNAL_FLASH_DEVICE_COUNT = 0
+EXTERNAL_FLASH_DEVICES =
diff --git a/ports/nrf/common-hal/neopixel_write/__init__.c b/ports/nrf/common-hal/neopixel_write/__init__.c
index f47188ea2..fe2bab999 100644
--- a/ports/nrf/common-hal/neopixel_write/__init__.c
+++ b/ports/nrf/common-hal/neopixel_write/__init__.c
@@ -86,7 +86,7 @@ static NRF_PWM_Type* find_free_pwm (void) {
#endif
};
- for ( int device = 0; device < ARRAY_SIZE(PWM); device++ ) {
+ for ( size_t device = 0; device < ARRAY_SIZE(PWM); device++ ) {
if ( (PWM[device]->ENABLE == 0) &&
(PWM[device]->PSEL.OUT[0] & PWM_PSEL_OUT_CONNECT_Msk) && (PWM[device]->PSEL.OUT[1] & PWM_PSEL_OUT_CONNECT_Msk) &&
(PWM[device]->PSEL.OUT[2] & PWM_PSEL_OUT_CONNECT_Msk) && (PWM[device]->PSEL.OUT[3] & PWM_PSEL_OUT_CONNECT_Msk) ) {
diff --git a/ports/nrf/common-hal/pulseio/PWMOut.c b/ports/nrf/common-hal/pulseio/PWMOut.c
index cf2330934..5485a75d0 100644
--- a/ports/nrf/common-hal/pulseio/PWMOut.c
+++ b/ports/nrf/common-hal/pulseio/PWMOut.c
@@ -58,7 +58,7 @@ STATIC uint16_t pwm_seq[MP_ARRAY_SIZE(pwms)][CHANNELS_PER_PWM];
static uint8_t never_reset_pwm[MP_ARRAY_SIZE(pwms)];
void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) {
- for(int i=0; i < MP_ARRAY_SIZE(pwms); i++) {
+ for(size_t i=0; i < MP_ARRAY_SIZE(pwms); i++) {
NRF_PWM_Type* pwm = pwms[i];
if (pwm == self->pwm) {
never_reset_pwm[i] += 1;
@@ -69,7 +69,7 @@ void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) {
}
void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) {
- for(int i=0; i < MP_ARRAY_SIZE(pwms); i++) {
+ for(size_t i=0; i < MP_ARRAY_SIZE(pwms); i++) {
NRF_PWM_Type* pwm = pwms[i];
if (pwm == self->pwm) {
never_reset_pwm[i] -= 1;
@@ -78,7 +78,7 @@ void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) {
}
void pwmout_reset(void) {
- for(int i=0; i < MP_ARRAY_SIZE(pwms); i++) {
+ for(size_t i=0; i < MP_ARRAY_SIZE(pwms); i++) {
if (never_reset_pwm[i] > 0) {
continue;
}
diff --git a/ports/nrf/common-hal/pulseio/PulseIn.c b/ports/nrf/common-hal/pulseio/PulseIn.c
index 6e5825af6..383966831 100644
--- a/ports/nrf/common-hal/pulseio/PulseIn.c
+++ b/ports/nrf/common-hal/pulseio/PulseIn.c
@@ -44,7 +44,7 @@ static pulseio_pulsein_obj_t* _objs[GPIOTE_CH_NUM];
// return index of the object in array
static int _find_pulsein_obj(pulseio_pulsein_obj_t* obj) {
- for(int i = 0; i < NRFX_ARRAY_SIZE(_objs); i++ ) {
+ for(size_t i = 0; i < NRFX_ARRAY_SIZE(_objs); i++ ) {
if ( _objs[i] == obj) {
return i;
}
@@ -63,7 +63,7 @@ static void _pulsein_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action
current_us = 1000 - current_us;
pulseio_pulsein_obj_t* self = NULL;
- for(int i = 0; i < NRFX_ARRAY_SIZE(_objs); i++ ) {
+ for(size_t i = 0; i < NRFX_ARRAY_SIZE(_objs); i++ ) {
if ( _objs[i] && _objs[i]->pin == pin ) {
self = _objs[i];
break;
diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h
index bdee568ac..cb6e2e350 100644
--- a/ports/nrf/mpconfigport.h
+++ b/ports/nrf/mpconfigport.h
@@ -4,6 +4,7 @@
* The MIT License (MIT)
*
* Copyright (c) 2015 Glenn Ruben Bakke
+ * Copyright (c) 2019 Dan Halbert for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -27,103 +28,18 @@
#ifndef NRF5_MPCONFIGPORT_H__
#define NRF5_MPCONFIGPORT_H__
-#include <mpconfigboard.h>
-
-// options to control how MicroPython is built
-#define MICROPY_ALLOC_PATH_MAX (512)
-#define MICROPY_PERSISTENT_CODE_LOAD (1)
-#define MICROPY_EMIT_THUMB (0)
-#define MICROPY_EMIT_INLINE_THUMB (0)
-#define MICROPY_COMP_MODULE_CONST (0)
-#define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (0)
-#define MICROPY_READER_VFS (MICROPY_VFS)
-#define MICROPY_ENABLE_GC (1)
-#define MICROPY_ENABLE_FINALISER (1)
-#define MICROPY_STACK_CHECK (0)
-#define MICROPY_HELPER_REPL (1)
-#define MICROPY_REPL_EMACS_KEYS (0)
-#define MICROPY_REPL_AUTO_INDENT (1)
-#define MICROPY_ENABLE_SOURCE_LINE (1)
-//CP UPDATE: See mpconfigport.h for LONGINT implementation
-#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
-#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
-#define MICROPY_FLOAT_HIGH_QUALITY_HASH (1)
-
-#define MICROPY_OPT_COMPUTED_GOTO (0)
-#define MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE (0)
-#define MICROPY_OPT_MPZ_BITWISE (0)
-
-// fatfs configuration used in ffconf.h
-#define MICROPY_FATFS_ENABLE_LFN (1)
-#define MICROPY_FATFS_LFN_CODE_PAGE (437) /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */
-#define MICROPY_FATFS_USE_LABEL (1)
-#define MICROPY_FATFS_RPATH (2)
-#define MICROPY_FATFS_MULTI_PARTITION (1)
-#define MICROPY_FATFS_NUM_PERSISTENT (1)
-
-//#define MICROPY_FATFS_MAX_SS (4096)
-#define FILESYSTEM_BLOCK_SIZE (512)
-
-#define MICROPY_VFS (1)
-#define MICROPY_VFS_FAT (MICROPY_VFS)
-
-// use vfs's functions for import stat and builtin open
-#if MICROPY_VFS
-#define mp_import_stat mp_vfs_import_stat
-#define mp_builtin_open mp_vfs_open
-#define mp_builtin_open_obj mp_vfs_open_obj
-#endif
-
#define MICROPY_CPYTHON_COMPAT (1)
-#define MICROPY_STREAMS_NON_BLOCK (1)
-#define MICROPY_MODULE_WEAK_LINKS (1)
-#define MICROPY_CAN_OVERRIDE_BUILTINS (1)
-#define MICROPY_USE_INTERNAL_ERRNO (0)
+//#define MICROPY_MODULE_BUILTIN_INIT (1) // TODO check this
+//#define MICROPY_MODULE_WEAK_LINKS (1) // TODO check this
+#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1)
#define MICROPY_PY_FUNCTION_ATTRS (1)
-#define MICROPY_PY_BUILTINS_STR_UNICODE (1)
-#define MICROPY_PY_BUILTINS_STR_CENTER (1)
-#define MICROPY_PY_BUILTINS_STR_PARTITION (1)
-#define MICROPY_PY_BUILTINS_STR_SPLITLINES (1)
-#define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
-#define MICROPY_PY_BUILTINS_FROZENSET (1)
-#define MICROPY_PY_BUILTINS_EXECFILE (0)
-#define MICROPY_PY_BUILTINS_COMPILE (1)
-#define MICROPY_PY_BUILTINS_HELP (1)
-#define MICROPY_PY_BUILTINS_HELP_MODULES (1)
-#define MICROPY_PY_BUILTINS_INPUT (1)
-#define MICROPY_MODULE_BUILTIN_INIT (1)
-#define MICROPY_PY_ALL_SPECIAL_METHODS (0)
-#define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
-#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)
-#define MICROPY_NONSTANDARD_TYPECODES (0)
-#define MICROPY_PY_BUILTINS_SLICE_ATTRS (1)
-#define MICROPY_PY_SYS_EXIT (1)
-#define MICROPY_PY_SYS_MAXSIZE (1)
-#define MICROPY_PY_SYS_STDFILES (1)
-#define MICROPY_PY_SYS_STDIO_BUFFER (1)
-#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (0)
-#define MICROPY_PY_MATH_SPECIAL_FUNCTIONS (0)
-#define MICROPY_PY_CMATH (0)
#define MICROPY_PY_IO (1)
-#define MICROPY_PY_IO_FILEIO (1)
-#define MICROPY_PY_UERRNO (0)
+#define MICROPY_PY_REVERSE_SPECIAL_METHODS (1)
+#define MICROPY_PY_SYS_STDIO_BUFFER (1)
#define MICROPY_PY_UBINASCII (1)
-#define MICROPY_PY_URANDOM (0)
-#define MICROPY_PY_URANDOM_EXTRA_FUNCS (0)
-#define MICROPY_PY_UCTYPES (0)
-#define MICROPY_PY_UZLIB (0)
#define MICROPY_PY_UJSON (1)
-#define MICROPY_PY_URE (0)
-#define MICROPY_PY_UHEAPQ (0)
-#define MICROPY_PY_UHASHLIB (1)
-#define MICROPY_PY_STRUCT (0)
-#define MICROPY_PY_FRAMEBUF (0)
-
-#define MICROPY_KBD_EXCEPTION (1)
-
-// Scan gamepad every 32ms
-#define CIRCUITPY_GAMEPAD_TICKS 0x1f
+// TODO this is old BLE stuff
#if BLUETOOTH_SD
#define MICROPY_PY_BLEIO (1)
#define MICROPY_PY_BLE_NUS (0)
@@ -133,114 +49,13 @@
#endif
#endif
-
-// type definitions for the specific machine
-
-#define BYTES_PER_WORD (4)
-
-#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void*)((mp_uint_t)(p) | 1))
-
-#define MP_SSIZE_MAX (0x7fffffff)
-
-#define UINT_FMT "%u"
-#define INT_FMT "%d"
-#define HEX2_FMT "%02x"
-
-typedef int mp_int_t; // must be pointer size
-typedef unsigned int mp_uint_t; // must be pointer size
-typedef long mp_off_t;
-
-#define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len)
-#define mp_type_fileio mp_type_vfs_fat_fileio
-#define mp_type_textio mp_type_vfs_fat_textio
-
-// extra built in modules to add to the list of known ones
-
-extern const struct _mp_obj_module_t microcontroller_module;
-extern const struct _mp_obj_module_t bitbangio_module;
-extern const struct _mp_obj_module_t analogio_module;
-extern const struct _mp_obj_module_t digitalio_module;
-extern const struct _mp_obj_module_t displayio_module;
-extern const struct _mp_obj_module_t pulseio_module;
-extern const struct _mp_obj_module_t busio_module;
-extern const struct _mp_obj_module_t board_module;
-extern const struct _mp_obj_module_t os_module;
-extern const struct _mp_obj_module_t random_module;
-extern const struct _mp_obj_module_t rotaryio_module;
-extern const struct _mp_obj_module_t storage_module;
-extern const struct _mp_obj_module_t struct_module;
-extern const struct _mp_obj_module_t time_module;
-extern const struct _mp_obj_module_t supervisor_module;
-extern const struct _mp_obj_module_t gamepad_module;
-extern const struct _mp_obj_module_t neopixel_write_module;
-extern const struct _mp_obj_module_t usb_hid_module;
-extern const struct _mp_obj_module_t usb_midi_module;
-extern const struct _mp_obj_module_t bleio_module;
-extern const struct _mp_obj_module_t touchio_module;
-
-
-#if MICROPY_PY_BLEIO
-#define BLEIO_MODULE { MP_ROM_QSTR(MP_QSTR_bleio), MP_ROM_PTR(&bleio_module) },
-#else
-#define BLEIO_MODULE
-#endif
-
-#ifdef NRF52840_XXAA
-#define USBHID_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_usb_hid), (mp_obj_t)&usb_hid_module },
-#else
-#define USBHID_MODULE
-#endif
-
-#define MICROPY_PORT_BUILTIN_MODULES \
- { MP_OBJ_NEW_QSTR (MP_QSTR_board ), (mp_obj_t)&board_module }, \
- { MP_OBJ_NEW_QSTR (MP_QSTR_busio ), (mp_obj_t)&busio_module }, \
- { MP_OBJ_NEW_QSTR (MP_QSTR_analogio ), (mp_obj_t)&analogio_module }, \
- { MP_OBJ_NEW_QSTR (MP_QSTR_digitalio ), (mp_obj_t)&digitalio_module }, \
- { MP_OBJ_NEW_QSTR (MP_QSTR_displayio ), (mp_obj_t)&displayio_module }, \
- { MP_OBJ_NEW_QSTR (MP_QSTR_pulseio ), (mp_obj_t)&pulseio_module }, \
- { MP_OBJ_NEW_QSTR (MP_QSTR_microcontroller ), (mp_obj_t)&microcontroller_module }, \
- { MP_OBJ_NEW_QSTR (MP_QSTR_neopixel_write ), (mp_obj_t)&neopixel_write_module }, \
- { MP_OBJ_NEW_QSTR (MP_QSTR_bitbangio ), (mp_obj_t)&bitbangio_module }, \
- { MP_OBJ_NEW_QSTR (MP_QSTR_os ), (mp_obj_t)&os_module }, \
- { MP_OBJ_NEW_QSTR (MP_QSTR_random ), (mp_obj_t)&random_module }, \
- { MP_OBJ_NEW_QSTR (MP_QSTR_rotaryio ), (mp_obj_t)&rotaryio_module }, \
- { MP_OBJ_NEW_QSTR (MP_QSTR_storage ), (mp_obj_t)&storage_module }, \
- { MP_OBJ_NEW_QSTR (MP_QSTR_struct ), (mp_obj_t)&struct_module }, \
- { MP_OBJ_NEW_QSTR (MP_QSTR_supervisor ), (mp_obj_t)&supervisor_module }, \
- { MP_OBJ_NEW_QSTR (MP_QSTR_gamepad ), (mp_obj_t)&gamepad_module }, \
- { MP_OBJ_NEW_QSTR (MP_QSTR_time ), (mp_obj_t)&time_module }, \
- { MP_OBJ_NEW_QSTR (MP_QSTR_json ), (mp_obj_t)&mp_module_ujson }, \
- { MP_OBJ_NEW_QSTR (MP_QSTR_touchio ), (mp_obj_t)&touchio_module }, \
- USBHID_MODULE \
- { MP_OBJ_NEW_QSTR(MP_QSTR_usb_midi),(mp_obj_t)&usb_midi_module }, \
- BLEIO_MODULE
-
-// extra built in names to add to the global namespace
-#define MICROPY_PORT_BUILTINS \
- { MP_ROM_QSTR (MP_QSTR_help ), MP_ROM_PTR(&mp_builtin_help_obj) }, \
- { MP_OBJ_NEW_QSTR (MP_QSTR_input ), (mp_obj_t)&mp_builtin_input_obj }, \
- { MP_ROM_QSTR (MP_QSTR_open ), MP_ROM_PTR(&mp_builtin_open_obj) }, \
-
-#define MP_STATE_PORT MP_STATE_VM
-
-#include "supervisor/flash_root_pointers.h"
+// 24kiB stack
+#define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000
#define MICROPY_PORT_ROOT_POINTERS \
- const char *readline_hist[8]; \
- mp_obj_t gamepad_singleton; \
- mp_obj_t terminal_tilegrid_tiles; \
- FLASH_ROOT_POINTERS \
-
-// We need to provide a declaration/definition of alloca()
-#include <alloca.h>
+ CIRCUITPY_COMMON_ROOT_POINTERS \
+ ;
-void run_background_tasks(void);
-#define MICROPY_VM_HOOK_LOOP run_background_tasks();
-#define MICROPY_VM_HOOK_RETURN run_background_tasks();
+#include "py/circuitpy_mpconfig.h"
-//#define CIRCUITPY_BOOT_OUTPUT_FILE "/boot_out.txt"
-#define CIRCUITPY_DEFAULT_STACK_SIZE 4096
-#define CIRCUITPY_DISPLAYIO (1)
-#define CIRCUITPY_DISPLAY_LIMIT (3)
-
-#endif
+#endif // NRF5_MPCONFIGPORT_H__
diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk
index f43e29fce..29b36ada8 100644
--- a/ports/nrf/mpconfigport.mk
+++ b/ports/nrf/mpconfigport.mk
@@ -3,6 +3,21 @@
# This should correspond to the MICROPY_LONGINT_IMPL definition in mpconfigport.h.
MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz
-INTERNAL_LIBM = (1)
+INTERNAL_LIBM = 1
USB_SERIAL_NUMBER_LENGTH = 16
+
+# No DAC, so no regular audio.
+CIRCUITPY_AUDIOIO = 0
+
+# No I2S yet.
+CIRCUITPY_AUDIOBUSIO = 0
+
+# No I2CSlave implementation
+CIRCUITPY_I2CSLAVE = 0
+
+# nvm not yet implemented
+CIRCUITPY_NVM = 0
+
+# rtc not yet implemented
+CIRCUITPY_RTC = 0
diff --git a/ports/nrf/supervisor/internal_flash.c b/ports/nrf/supervisor/internal_flash.c
index 5faae8a4e..4351f3da6 100644
--- a/ports/nrf/supervisor/internal_flash.c
+++ b/ports/nrf/supervisor/internal_flash.c
@@ -71,7 +71,7 @@ uint32_t supervisor_flash_get_block_count(void) {
}
#ifdef BLUETOOTH_SD
-STATIC bool wait_for_flash_operation() {
+STATIC bool wait_for_flash_operation(void) {
do {
sd_app_evt_wait();
uint32_t evt_id;
diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk
new file mode 100644
index 000000000..2fa2e78e2
--- /dev/null
+++ b/py/circuitpy_defns.mk
@@ -0,0 +1,346 @@
+# This file is part of the MicroPython project, http://micropython.org/
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2019 Dan Halbert for Adafruit Industries
+#
+# 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.
+
+# Common Makefile definitions that can be shared across CircuitPython ports.
+
+###
+# Common compile warnings.
+
+BASE_CFLAGS = \
+ -fsingle-precision-constant \
+ -fno-strict-aliasing \
+ -Wdouble-promotion \
+ -Wno-endif-labels \
+ -Wstrict-prototypes \
+ -Werror-implicit-function-declaration \
+ -Wfloat-equal \
+ -Wundef \
+ -Wshadow \
+ -Wwrite-strings \
+ -Wsign-compare \
+ -Wmissing-format-attribute \
+ -Wno-deprecated-declarations \
+ -Wnested-externs \
+ -Wunreachable-code \
+ -Wcast-align \
+ -Wno-error=lto-type-mismatch \
+ -D__$(CHIP_VARIANT)__ \
+ -ffunction-sections \
+ -fdata-sections \
+ -fshort-enums \
+ -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF \
+ -DCIRCUITPY_CANARY_WORD=0xADAF00 \
+ -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF \
+ --param max-inline-insns-single=500
+
+# Use these flags to debug build times and header includes.
+# -ftime-report
+# -H
+
+
+###
+# Handle frozen modules.
+
+ifneq ($(FROZEN_DIR),)
+# To use frozen source modules, put your .py files in a subdirectory (eg scripts/)
+# and then invoke make with FROZEN_DIR=scripts (be sure to build from scratch).
+CFLAGS += -DMICROPY_MODULE_FROZEN_STR
+CFLAGS += -Wno-error=lto-type-mismatch
+endif
+
+# To use frozen bytecode, put your .py files in a subdirectory (eg frozen/) and
+# then invoke make with FROZEN_MPY_DIR=frozen or FROZEN_MPY_DIRS="dir1 dir2"
+# (be sure to build from scratch).
+
+ifneq ($(FROZEN_MPY_DIRS),)
+CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
+CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
+CFLAGS += -Wno-error=lto-type-mismatch
+endif
+
+
+###
+# Propagate longint choice from .mk to C. There's no easy string comparison
+# in cpp conditionals, so we #define separate names for each.
+ifeq ($(LONGINT_IMPL),NONE)
+CFLAGS += -DLONGINT_IMPL_NONE
+endif
+
+ifeq ($(LONGINT_IMPL),MPZ)
+CFLAGS += -DLONGINT_IMPL_MPZ
+endif
+
+ifeq ($(LONGINT_IMPL),LONGLONG)
+CFLAGS += -DLONGINT_IMPL_LONGLONG
+endif
+
+
+###
+# Select which builtin modules to compile and include.
+
+ifeq ($(CIRCUITPY_ANALOGIO),1)
+SRC_PATTERNS += analogio/%
+endif
+ifeq ($(CIRCUITPY_AUDIOBUSIO),1)
+SRC_PATTERNS += audiobusio/%
+endif
+ifeq ($(CIRCUITPY_AUDIOIO),1)
+SRC_PATTERNS += audioio/%
+endif
+ifeq ($(CIRCUITPY_BITBANGIO),1)
+SRC_PATTERNS += bitbangio/%
+endif
+ifeq ($(CIRCUITPY_BLEIO),1)
+SRC_PATTERNS += bleio/%
+endif
+ifeq ($(CIRCUITPY_BOARD),1)
+SRC_PATTERNS += board/%
+endif
+ifeq ($(CIRCUITPY_BUSIO),1)
+SRC_PATTERNS += busio/% bitbangio/OneWire.%
+endif
+ifeq ($(CIRCUITPY_DIGITALIO),1)
+SRC_PATTERNS += digitalio/%
+endif
+ifeq ($(CIRCUITPY_DISPLAYIO),1)
+SRC_PATTERNS += displayio/% terminalio/%
+endif
+ifeq ($(CIRCUITPY_GAMEPAD),1)
+SRC_PATTERNS += gamepad/%
+endif
+ifeq ($(CIRCUITPY_I2CSLAVE),1)
+SRC_PATTERNS += i2cslave/%
+endif
+ifeq ($(CIRCUITPY_MATH),1)
+SRC_PATTERNS += math/%
+endif
+ifeq ($(CIRCUITPY_MICROCONTROLLER),1)
+SRC_PATTERNS += microcontroller/%
+endif
+ifeq ($(CIRCUITPY_NEOPIXEL_WRITE),1)
+SRC_PATTERNS += neopixel_write/%
+endif
+ifeq ($(CIRCUITPY_NETWORK),1)
+SRC_PATTERNS += network/% socket/%
+endif
+ifeq ($(CIRCUITPY_NVM),1)
+SRC_PATTERNS += nvm/%
+endif
+ifeq ($(CIRCUITPY_OS),1)
+SRC_PATTERNS += os/%
+endif
+ifeq ($(CIRCUITPY_PIXELBUF),1)
+SRC_PATTERNS += _pixelbuf/%
+endif
+ifeq ($(CIRCUITPY_PULSEIO),1)
+SRC_PATTERNS += pulseio/%
+endif
+ifeq ($(CIRCUITPY_RANDOM),1)
+SRC_PATTERNS += random/%
+endif
+ifeq ($(CIRCUITPY_ROTARYIO),1)
+SRC_PATTERNS += rotaryio/%
+endif
+ifeq ($(CIRCUITPY_RTC),1)
+SRC_PATTERNS += rtc/%
+endif
+ifeq ($(CIRCUITPY_SAMD),1)
+SRC_PATTERNS += samd/%
+endif
+ifeq ($(CIRCUITPY_STAGE),1)
+SRC_PATTERNS += _stage/%
+endif
+ifeq ($(CIRCUITPY_STORAGE),1)
+SRC_PATTERNS += storage/%
+endif
+ifeq ($(CIRCUITPY_STRUCT),1)
+SRC_PATTERNS += struct/%
+endif
+ifeq ($(CIRCUITPY_SUPERVISOR),1)
+SRC_PATTERNS += supervisor/%
+endif
+ifeq ($(CIRCUITPY_TIME),1)
+SRC_PATTERNS += time/%
+endif
+ifeq ($(CIRCUITPY_TOUCHIO),1)
+SRC_PATTERNS += touchio/%
+endif
+ifeq ($(CIRCUITPY_UHEAP),1)
+SRC_PATTERNS += uheap/%
+endif
+ifeq ($(CIRCUITPY_USB_HID),1)
+SRC_PATTERNS += usb_hid/%
+endif
+ifeq ($(CIRCUITPY_USB_MIDI),1)
+SRC_PATTERNS += usb_midi/%
+endif
+ifeq ($(CIRCUITPY_USTACK),1)
+SRC_PATTERNS += ustack/%
+endif
+
+# All possible sources are listed here, and are filtered by SRC_PATTERNS.
+SRC_COMMON_HAL = \
+$(filter $(SRC_PATTERNS), \
+ analogio/AnalogIn.c \
+ analogio/AnalogOut.c \
+ analogio/__init__.c \
+ audiobusio/__init__.c \
+ audiobusio/I2SOut.c \
+ audiobusio/PDMIn.c \
+ audioio/__init__.c \
+ audioio/AudioOut.c \
+ bleio/__init__.c \
+ bleio/Adapter.c \
+ bleio/Broadcaster.c \
+ bleio/Characteristic.c \
+ bleio/CharacteristicBuffer.c \
+ bleio/Descriptor.c \
+ bleio/Peripheral.c \
+ bleio/Scanner.c \
+ bleio/Service.c \
+ bleio/UUID.c \
+ board/__init__.c \
+ busio/I2C.c \
+ busio/SPI.c \
+ busio/UART.c \
+ busio/__init__.c \
+ digitalio/DigitalInOut.c \
+ digitalio/__init__.c \
+ displayio/ParallelBus.c \
+ i2cslave/I2CSlave.c \
+ i2cslave/__init__.c \
+ microcontroller/Pin.c \
+ microcontroller/Processor.c \
+ microcontroller/__init__.c \
+ neopixel_write/__init__.c \
+ nvm/ByteArray.c \
+ nvm/__init__.c \
+ os/__init__.c \
+ pulseio/PWMOut.c \
+ pulseio/PulseIn.c \
+ pulseio/PulseOut.c \
+ pulseio/__init__.c \
+ rotaryio/IncrementalEncoder.c \
+ rotaryio/__init__.c \
+ rtc/RTC.c \
+ rtc/__init__.c \
+ supervisor/Runtime.c \
+ supervisor/__init__.c \
+ time/__init__.c \
+ touchio/TouchIn.c \
+ touchio/__init__.c \
+)
+
+# These don't have corresponding files in each port but are still located in
+# shared-bindings to make it clear what the contents of the modules are.
+# All possible sources are listed here, and are filtered by SRC_PATTERNS.
+SRC_BINDINGS_ENUMS = \
+$(filter $(SRC_PATTERNS), \
+ digitalio/Direction.c \
+ digitalio/DriveMode.c \
+ digitalio/Pull.c \
+ displayio/Glyph.c \
+ microcontroller/RunMode.c \
+ math/__init__.c \
+ supervisor/__init__.c \
+)
+
+SRC_BINDINGS_ENUMS += \
+ help.c \
+ util.c
+
+SRC_BINDINGS_ENUMS += \
+$(filter $(SRC_PATTERNS), \
+ bleio/Address.c \
+ bleio/AddressType.c \
+ bleio/AdvertisementData.c \
+ bleio/ScanEntry.c \
+)
+
+# All possible sources are listed here, and are filtered by SRC_PATTERNS.
+SRC_SHARED_MODULE = \
+$(filter $(SRC_PATTERNS), \
+ _pixelbuf/PixelBuf.c \
+ _pixelbuf/__init__.c \
+ _stage/Layer.c \
+ _stage/Text.c \
+ _stage/__init__.c \
+ audioio/__init__.c \
+ audioio/Mixer.c \
+ audioio/RawSample.c \
+ audioio/WaveFile.c \
+ bitbangio/I2C.c \
+ bitbangio/OneWire.c \
+ bitbangio/SPI.c \
+ bitbangio/__init__.c \
+ busio/OneWire.c \
+ displayio/Bitmap.c \
+ displayio/BuiltinFont.c \
+ displayio/ColorConverter.c \
+ displayio/Display.c \
+ displayio/FourWire.c \
+ displayio/Group.c \
+ displayio/OnDiskBitmap.c \
+ displayio/Palette.c \
+ displayio/Shape.c \
+ displayio/TileGrid.c \
+ displayio/__init__.c \
+ gamepad/GamePad.c \
+ gamepad/__init__.c \
+ os/__init__.c \
+ random/__init__.c \
+ socket/__init__.c \
+ network/__init__.c \
+ storage/__init__.c \
+ struct/__init__.c \
+ terminalio/Terminal.c \
+ terminalio/__init__.c \
+ uheap/__init__.c \
+ ustack/__init__.c \
+)
+
+ifeq ($(INTERNAL_LIBM),1)
+SRC_LIBM = \
+$(addprefix lib/,\
+ libm/math.c \
+ libm/roundf.c \
+ libm/fmodf.c \
+ libm/nearbyintf.c \
+ libm/ef_sqrt.c \
+ libm/kf_rem_pio2.c \
+ libm/kf_sin.c \
+ libm/kf_cos.c \
+ libm/kf_tan.c \
+ libm/ef_rem_pio2.c \
+ libm/sf_sin.c \
+ libm/sf_cos.c \
+ libm/sf_tan.c \
+ libm/sf_frexp.c \
+ libm/sf_modf.c \
+ libm/sf_ldexp.c \
+ libm/asinfacosf.c \
+ libm/atanf.c \
+ libm/atan2f.c \
+ )
+endif
diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h
new file mode 100644
index 000000000..721b3c538
--- /dev/null
+++ b/py/circuitpy_mpconfig.h
@@ -0,0 +1,533 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2019 Dan Halbert for Adafruit Industries
+ *
+ * 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.
+ */
+
+// This file contains settings that are common across CircuitPython ports, to make
+// sure that the same feature set and settings are used, such as in atmel-samd
+// and nrf.
+
+#include <stdint.h>
+
+#ifndef __INCLUDED_MPCONFIG_CIRCUITPY_H
+#define __INCLUDED_MPCONFIG_CIRCUITPY_H
+
+// REPR_C encodes qstrs, 31-bit ints, and 30-bit floats in a single 32-bit word.
+#define MICROPY_OBJ_REPR (MICROPY_OBJ_REPR_C)
+
+// options to control how MicroPython is built
+// TODO(tannewt): Reduce this number if we want the REPL to function under 512
+// free bytes.
+// #define MICROPY_ALLOC_PARSE_RULE_INIT (64)
+
+// Sorted alphabetically for easy finding.
+//
+// default is 128; consider raising to reduce fragmentation.
+#define MICROPY_ALLOC_PARSE_CHUNK_INIT (16)
+// default is 512.
+#define MICROPY_ALLOC_PATH_MAX (256)
+#define MICROPY_CAN_OVERRIDE_BUILTINS (1)
+#define MICROPY_COMP_CONST (1)
+#define MICROPY_COMP_DOUBLE_TUPLE_ASSIGN (1)
+#define MICROPY_COMP_MODULE_CONST (1)
+#define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (0)
+#define MICROPY_DEBUG_PRINTERS (0)
+#define MICROPY_EMIT_INLINE_THUMB (0)
+#define MICROPY_EMIT_THUMB (0)
+#define MICROPY_EMIT_X64 (0)
+#define MICROPY_ENABLE_DOC_STRING (0)
+#define MICROPY_ENABLE_FINALISER (1)
+#define MICROPY_ENABLE_GC (1)
+#define MICROPY_ENABLE_SOURCE_LINE (1)
+#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_NORMAL)
+#define MICROPY_FLOAT_HIGH_QUALITY_HASH (0)
+#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
+#define MICROPY_GC_ALLOC_THRESHOLD (0)
+#define MICROPY_HELPER_LEXER_UNIX (0)
+#define MICROPY_HELPER_REPL (1)
+#define MICROPY_KBD_EXCEPTION (1)
+#define MICROPY_MEM_STATS (0)
+#define MICROPY_NONSTANDARD_TYPECODES (0)
+#define MICROPY_PERSISTENT_CODE_LOAD (1)
+
+#define MICROPY_PY_ARRAY (1)
+#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)
+#define MICROPY_PY_ASYNC_AWAIT (0)
+#define MICROPY_PY_ATTRTUPLE (1)
+
+#define MICROPY_PY_BUILTINS_BYTEARRAY (1)
+#define MICROPY_PY_BUILTINS_ENUMERATE (1)
+#define MICROPY_PY_BUILTINS_FILTER (1)
+#define MICROPY_PY_BUILTINS_HELP (1)
+#define MICROPY_PY_BUILTINS_HELP_MODULES (1)
+#define MICROPY_PY_BUILTINS_INPUT (1)
+#define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
+#define MICROPY_PY_BUILTINS_MIN_MAX (1)
+#define MICROPY_PY_BUILTINS_PROPERTY (1)
+#define MICROPY_PY_BUILTINS_SET (1)
+#define MICROPY_PY_BUILTINS_SLICE (1)
+#define MICROPY_PY_BUILTINS_SLICE_ATTRS (1)
+#define MICROPY_PY_BUILTINS_STR_UNICODE (1)
+
+#define MICROPY_PY_CMATH (0)
+#define MICROPY_PY_COLLECTIONS (1)
+#define MICROPY_PY_DESCRIPTORS (1)
+#define MICROPY_PY_IO_FILEIO (1)
+#define MICROPY_PY_GC (1)
+// Supplanted by shared-bindings/math
+#define MICROPY_PY_MATH (0)
+#define MICROPY_PY_MICROPYTHON_MEM_INFO (0)
+// Supplanted by shared-bindings/struct
+#define MICROPY_PY_STRUCT (0)
+#define MICROPY_PY_SYS (1)
+#define MICROPY_PY_SYS_MAXSIZE (1)
+#define MICROPY_PY_SYS_STDFILES (1)
+// Supplanted by shared-bindings/random
+#define MICROPY_PY_URANDOM (0)
+#define MICROPY_PY_URANDOM_EXTRA_FUNCS (0)
+#define MICROPY_PY___FILE__ (1)
+
+#define MICROPY_QSTR_BYTES_IN_HASH (1)
+#define MICROPY_REPL_AUTO_INDENT (1)
+#define MICROPY_REPL_EVENT_DRIVEN (0)
+#define MICROPY_STACK_CHECK (1)
+#define MICROPY_STREAMS_NON_BLOCK (1)
+#define MICROPY_USE_INTERNAL_PRINTF (1)
+
+// fatfs configuration used in ffconf.h
+//
+// 1 = SFN/ANSI 437=LFN/U.S.(OEM)
+#define MICROPY_FATFS_ENABLE_LFN (1)
+#define MICROPY_FATFS_LFN_CODE_PAGE (437)
+#define MICROPY_FATFS_USE_LABEL (1)
+#define MICROPY_FATFS_RPATH (2)
+#define MICROPY_FATFS_MULTI_PARTITION (1)
+#define MICROPY_FATFS_NUM_PERSISTENT (1)
+
+// Only enable this if you really need it. It allocates a byte cache of this size.
+// #define MICROPY_FATFS_MAX_SS (4096)
+
+#define FILESYSTEM_BLOCK_SIZE (512)
+
+#define MICROPY_VFS (1)
+#define MICROPY_VFS_FAT (MICROPY_VFS)
+#define MICROPY_READER_VFS (MICROPY_VFS)
+
+
+// type definitions for the specific machine
+
+#define BYTES_PER_WORD (4)
+
+#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void*)((mp_uint_t)(p) | 1))
+
+// Track stack usage. Expose results via ustack module.
+#define MICROPY_MAX_STACK_USAGE (0)
+
+// This port is intended to be 32-bit, but unfortunately, int32_t for
+// different targets may be defined in different ways - either as int
+// or as long. This requires different printf formatting specifiers
+// to print such value. So, we avoid int32_t and use int directly.
+#define UINT_FMT "%u"
+#define INT_FMT "%d"
+typedef int mp_int_t; // must be pointer size
+typedef unsigned mp_uint_t; // must be pointer size
+typedef long mp_off_t;
+
+#define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len)
+
+#define mp_type_fileio mp_type_vfs_fat_fileio
+#define mp_type_textio mp_type_vfs_fat_textio
+
+#define mp_import_stat mp_vfs_import_stat
+#define mp_builtin_open_obj mp_vfs_open_obj
+
+// extra built in names to add to the global namespace
+#define MICROPY_PORT_BUILTINS \
+ { MP_OBJ_NEW_QSTR(MP_QSTR_help), (mp_obj_t)&mp_builtin_help_obj }, \
+ { MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \
+ { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
+
+
+// board specific definitions
+#include "mpconfigboard.h"
+
+// CIRCUITPY_FULL_BUILD is defined in a *.mk file.
+
+// Remove some lesser-used functionality to make small builds fit.
+#define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (CIRCUITPY_FULL_BUILD)
+#define MICROPY_PY_ALL_SPECIAL_METHODS (CIRCUITPY_FULL_BUILD)
+#define MICROPY_PY_BUILTINS_COMPLEX (CIRCUITPY_FULL_BUILD)
+#define MICROPY_PY_BUILTINS_FROZENSET (CIRCUITPY_FULL_BUILD)
+#define MICROPY_PY_BUILTINS_REVERSED (CIRCUITPY_FULL_BUILD)
+#define MICROPY_PY_BUILTINS_STR_CENTER (CIRCUITPY_FULL_BUILD)
+#define MICROPY_PY_BUILTINS_STR_PARTITION (CIRCUITPY_FULL_BUILD)
+#define MICROPY_PY_BUILTINS_STR_SPLITLINES (CIRCUITPY_FULL_BUILD)
+#define MICROPY_PY_UERRNO (CIRCUITPY_FULL_BUILD)
+// Opposite setting is deliberate.
+#define MICROPY_PY_UERRNO_ERRORCODE (!CIRCUITPY_FULL_BUILD)
+#define MICROPY_PY_URE (CIRCUITPY_FULL_BUILD)
+#define MICROPY_PY_URE_MATCH_GROUPS (CIRCUITPY_FULL_BUILD)
+#define MICROPY_PY_URE_MATCH_SPAN_START_END (CIRCUITPY_FULL_BUILD)
+#define MICROPY_PY_URE_SUB (CIRCUITPY_FULL_BUILD)
+
+// LONGINT_IMPL_xxx are defined in the Makefile.
+//
+#ifdef LONGINT_IMPL_NONE
+#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_NONE)
+#endif
+
+#ifdef LONGINT_IMPL_MPZ
+#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
+#define MP_SSIZE_MAX (0x7fffffff)
+#endif
+
+#ifdef LONGINT_IMPL_LONGLONG
+#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_LONGLONG)
+#endif
+
+
+// These CIRCUITPY_xxx values should all be defined in the *.mk files as being on or off.
+// So if any are not defined in *.mk, they'll throw an error here.
+
+#if CIRCUITPY_ANALOGIO
+#define ANALOGIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_analogio), (mp_obj_t)&analogio_module },
+extern const struct _mp_obj_module_t analogio_module;
+#else
+#define ANALOGIO_MODULE
+#endif
+
+#if CIRCUITPY_AUDIOBUSIO
+#define AUDIOBUSIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_audiobusio), (mp_obj_t)&audiobusio_module },
+extern const struct _mp_obj_module_t audiobusio_module;
+#else
+#define AUDIOBUSIO_MODULE
+#endif
+
+#if CIRCUITPY_AUDIOIO
+#define AUDIOIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_audioio), (mp_obj_t)&audioio_module },
+extern const struct _mp_obj_module_t audioio_module;
+#else
+#define AUDIOIO_MODULE
+#endif
+
+#if CIRCUITPY_BITBANGIO
+#define BITBANGIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_bitbangio), (mp_obj_t)&bitbangio_module },
+extern const struct _mp_obj_module_t bitbangio_module;
+#else
+#define BITBANGIO_MODULE
+#endif
+
+#if CIRCUITPY_BLEIO
+#define BLEIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_bleio), (mp_obj_t)&bleio_module },
+extern const struct _mp_obj_module_t bleio_module;
+#else
+#define BLEIO_MODULE
+#endif
+
+#if CIRCUITPY_BOARD
+#define BOARD_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_board), (mp_obj_t)&board_module },
+extern const struct _mp_obj_module_t board_module;
+#else
+#define BOARD_MODULE
+#endif
+
+#if CIRCUITPY_BUSIO
+extern const struct _mp_obj_module_t busio_module;
+#define BUSIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_busio), (mp_obj_t)&busio_module },
+#else
+#define BUSIO_MODULE
+#endif
+
+#if CIRCUITPY_DIGITALIO
+extern const struct _mp_obj_module_t digitalio_module;
+#define DIGITALIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_digitalio), (mp_obj_t)&digitalio_module },
+#else
+#define DIGITALIO_MODULE
+#endif
+
+#if CIRCUITPY_DISPLAYIO
+extern const struct _mp_obj_module_t displayio_module;
+extern const struct _mp_obj_module_t terminalio_module;
+#define DISPLAYIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_displayio), (mp_obj_t)&displayio_module },
+#define TERMINALIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_terminalio), (mp_obj_t)&terminalio_module },
+#define CIRCUITPY_DISPLAY_LIMIT (3)
+#else
+#define DISPLAYIO_MODULE
+#define TERMINALIO_MODULE
+#define CIRCUITPY_DISPLAY_LIMIT (0)
+#endif
+
+#if CIRCUITPY_GAMEPAD
+extern const struct _mp_obj_module_t gamepad_module;
+// Scan gamepad every 32ms
+#define CIRCUITPY_GAMEPAD_TICKS 0x1f
+#define GAMEPAD_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_gamepad),(mp_obj_t)&gamepad_module },
+#else
+#define GAMEPAD_MODULE
+#endif
+
+#if CIRCUITPY_I2CSLAVE
+extern const struct _mp_obj_module_t i2cslave_module;
+#define I2CSLAVE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_i2cslave), (mp_obj_t)&i2cslave_module },
+#else
+#define I2CSLAVE_MODULE
+#endif
+
+#if CIRCUITPY_MATH
+extern const struct _mp_obj_module_t math_module;
+#define MATH_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_math), (mp_obj_t)&math_module },
+#else
+#define MATH_MODULE
+#endif
+
+#if CIRCUITPY_MICROCONTROLLER
+extern const struct _mp_obj_module_t microcontroller_module;
+#define MICROCONTROLLER_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_microcontroller), (mp_obj_t)&microcontroller_module },
+#else
+#define MICROCONTROLLER_MODULE
+#endif
+
+#if CIRCUITPY_NEOPIXEL_WRITE
+extern const struct _mp_obj_module_t neopixel_write_module;
+#define NEOPIXEL_WRITE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_neopixel_write),(mp_obj_t)&neopixel_write_module },
+#else
+#define NEOPIXEL_WRITE_MODULE
+#endif
+
+#if CIRCUITPY_NETWORK
+extern const struct _mp_obj_module_t network_module;
+extern const struct _mp_obj_module_t socket_module;
+#define NETWORK_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_network), (mp_obj_t)&network_module },
+#define SOCKET_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_socket), (mp_obj_t)&socket_module },
+#define NETWORK_ROOT_POINTERS mp_obj_list_t mod_network_nic_list;
+#if MICROPY_PY_WIZNET5K
+ extern const struct _mp_obj_module_t wiznet_module;
+ #define WIZNET_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_wiznet), (mp_obj_t)&wiznet_module },
+#endif
+#else
+#define NETWORK_MODULE
+#define SOCKET_MODULE
+#define WIZNET_MODULE
+#define NETWORK_ROOT_POINTERS
+#endif
+
+// This is not a top-level module; it's microcontroller.nvm.
+#if CIRCUITPY_NVM
+extern const struct _mp_obj_module_t nvm_module;
+#endif
+
+#if CIRCUITPY_OS
+extern const struct _mp_obj_module_t os_module;
+#define OS_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_os), (mp_obj_t)&os_module },
+#else
+#define OS_MODULE
+#endif
+
+#if CIRCUITPY_PIXELBUF
+extern const struct _mp_obj_module_t pixelbuf_module;
+#define PIXELBUF_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__pixelbuf),(mp_obj_t)&pixelbuf_module },
+#else
+#define PIXELBUF_MODULE
+#endif
+
+#if CIRCUITPY_PULSEIO
+extern const struct _mp_obj_module_t pulseio_module;
+#define PULSEIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_pulseio), (mp_obj_t)&pulseio_module },
+#else
+#define PULSEIO_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 },
+#else
+#define RANDOM_MODULE
+#endif
+
+#if CIRCUITPY_ROTARYIO
+extern const struct _mp_obj_module_t rotaryio_module;
+#define ROTARYIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_rotaryio), (mp_obj_t)&rotaryio_module },
+#else
+#define ROTARYIO_MODULE
+#endif
+
+#if CIRCUITPY_RTC
+extern const struct _mp_obj_module_t rtc_module;
+#define RTC_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_rtc), (mp_obj_t)&rtc_module },
+#else
+#define RTC_MODULE
+#endif
+
+#if CIRCUITPY_SAMD
+extern const struct _mp_obj_module_t samd_module;
+#define SAMD_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_samd),(mp_obj_t)&samd_module },
+#else
+#define SAMD_MODULE
+#endif
+
+#if CIRCUITPY_STAGE
+extern const struct _mp_obj_module_t stage_module;
+#define STAGE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__stage), (mp_obj_t)&stage_module },
+#else
+#define STAGE_MODULE
+#endif
+
+#if CIRCUITPY_STORAGE
+extern const struct _mp_obj_module_t storage_module;
+#define STORAGE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_storage), (mp_obj_t)&storage_module },
+#else
+#define STORAGE_MODULE
+#endif
+
+#if CIRCUITPY_STRUCT
+extern const struct _mp_obj_module_t struct_module;
+#define STRUCT_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_struct), (mp_obj_t)&struct_module },
+#else
+#define STRUCT_MODULE
+#endif
+
+#if CIRCUITPY_SUPERVISOR
+extern const struct _mp_obj_module_t supervisor_module;
+#define SUPERVISOR_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_supervisor), (mp_obj_t)&supervisor_module },
+#else
+#define SUPERVISOR_MODULE
+#endif
+
+#if CIRCUITPY_TIME
+extern const struct _mp_obj_module_t time_module;
+#define TIME_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&time_module },
+#else
+#define TIME_MODULE
+#endif
+
+#if CIRCUITPY_TOUCHIO
+extern const struct _mp_obj_module_t touchio_module;
+#define TOUCHIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_touchio), (mp_obj_t)&touchio_module },
+#else
+#define TOUCHIO_MODULE
+#endif
+
+#if CIRCUITPY_UHEAP
+extern const struct _mp_obj_module_t uheap_module;
+#define UHEAP_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_uheap),(mp_obj_t)&uheap_module },
+#else
+#define UHEAP_MODULE
+#endif
+
+#if CIRCUITPY_USB_HID
+extern const struct _mp_obj_module_t usb_hid_module;
+#define USB_HID_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_usb_hid),(mp_obj_t)&usb_hid_module },
+#else
+#define USB_HID_MODULE
+#endif
+
+#if CIRCUITPY_USB_MIDI
+extern const struct _mp_obj_module_t usb_midi_module;
+#define USB_MIDI_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_usb_midi),(mp_obj_t)&usb_midi_module },
+#else
+#define USB_MIDI_MODULE
+#endif
+
+#if CIRCUITPY_USTACK
+extern const struct _mp_obj_module_t ustack_module;
+#define USTACK_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_ustack),(mp_obj_t)&ustack_module },
+#else
+#define USTACK_MODULE
+#endif
+
+#if MICROPY_PY_UJSON
+#define JSON_MODULE { MP_ROM_QSTR(MP_QSTR_json), MP_ROM_PTR(&mp_module_ujson) },
+#else
+#define JSON_MODULE
+#endif
+
+// This is an inclusive list that should correspond to the CIRCUITPY_XXX list above,
+// including dependendencies such as TERMINALIO depending on DISPLAYIO (shown by indentation).
+// Some of these definitions will be blank depending on what is turned on and off.
+//
+#define MICROPY_PORT_BUILTIN_MODULES \
+ ANALOGIO_MODULE \
+ AUDIOBUSIO_MODULE \
+ AUDIOIO_MODULE \
+ BITBANGIO_MODULE \
+ BLEIO_MODULE \
+ BOARD_MODULE \
+ BUSIO_MODULE \
+ DIGITALIO_MODULE \
+ TERMINALIO_MODULE \
+ DISPLAYIO_MODULE \
+ GAMEPAD_MODULE \
+ I2CSLAVE_MODULE \
+ JSON_MODULE \
+ MATH_MODULE \
+ MICROCONTROLLER_MODULE \
+ NEOPIXEL_WRITE_MODULE \
+ NETWORK_MODULE \
+ SOCKET_MODULE \
+ WIZNET_MODULE \
+ OS_MODULE \
+ PIXELBUF_MODULE \
+ PULSEIO_MODULE \
+ RANDOM_MODULE \
+ RTC_MODULE \
+ SAMD_MODULE \
+ STAGE_MODULE \
+ STORAGE_MODULE \
+ STRUCT_MODULE \
+ SUPERVISOR_MODULE \
+ TIME_MODULE \
+ TOUCHIO_MODULE \
+ UHEAP_MODULE \
+ USB_HID_MODULE \
+ USB_MIDI_MODULE \
+ USTACK_MODULE \
+
+// We need to provide a declaration/definition of alloca()
+#include <alloca.h>
+
+#define MP_STATE_PORT MP_STATE_VM
+
+#include "supervisor/flash_root_pointers.h"
+
+#define CIRCUITPY_COMMON_ROOT_POINTERS \
+ const char *readline_hist[8]; \
+ vstr_t *repl_line; \
+ mp_obj_t rtc_time_source; \
+ mp_obj_t gamepad_singleton; \
+ mp_obj_t terminal_tilegrid_tiles; \
+ FLASH_ROOT_POINTERS \
+ NETWORK_ROOT_POINTERS \
+
+void run_background_tasks(void);
+
+// TODO: Used in wiznet5k driver, but may not be needed in the long run.
+#define MICROPY_THREAD_YIELD()
+
+#define MICROPY_VM_HOOK_LOOP run_background_tasks();
+#define MICROPY_VM_HOOK_RETURN run_background_tasks();
+
+#define CIRCUITPY_AUTORELOAD_DELAY_MS 500
+#define CIRCUITPY_BOOT_OUTPUT_FILE "/boot_out.txt"
+
+#endif // __INCLUDED_MPCONFIG_CIRCUITPY_H
diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk
new file mode 100644
index 000000000..30d5a7554
--- /dev/null
+++ b/py/circuitpy_mpconfig.mk
@@ -0,0 +1,223 @@
+#
+# This file is part of the MicroPython project, http://micropython.org/
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2019 Dan Halbert for Adafruit Industries
+#
+# 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.
+
+
+# mpconfigboard.mk files can specify:
+# CIRCUITPY_FULL_BUILD = 1 (which is the default)
+# or
+# CIRCUITPY_SMALL_BUILD = 1
+# which is the same as:
+# 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
+endif
+
+# All builtin modules are listed below, with default values (0 for off, 1 for on)
+# Some are always on, some are always off, and some depend on CIRCUITPY_FULL_BUILD.
+#
+# *** You can override any of the defaults by defining them in your mpconfigboard.mk.
+
+ifndef CIRCUITPY_ANALOGIO
+CIRCUITPY_ANALOGIO = 1
+endif
+CFLAGS += -DCIRCUITPY_ANALOGIO=$(CIRCUITPY_ANALOGIO)
+
+ifndef CIRCUITPY_AUDIOBUSIO
+CIRCUITPY_AUDIOBUSIO = $(CIRCUITPY_FULL_BUILD)
+endif
+CFLAGS += -DCIRCUITPY_AUDIOBUSIO=$(CIRCUITPY_AUDIOBUSIO)
+
+ifndef CIRCUITPY_AUDIOIO
+CIRCUITPY_AUDIOIO = $(CIRCUITPY_FULL_BUILD)
+endif
+CFLAGS += -DCIRCUITPY_AUDIOIO=$(CIRCUITPY_AUDIOIO)
+
+ifndef CIRCUITPY_BITBANGIO
+CIRCUITPY_BITBANGIO = $(CIRCUITPY_FULL_BUILD)
+endif
+CFLAGS += -DCIRCUITPY_BITBANGIO=$(CIRCUITPY_BITBANGIO)
+
+# Explicitly enabled for boards that support bleio.
+ifndef CIRCUITPY_BLEIO
+CIRCUITPY_BLEIO = 0
+endif
+CFLAGS += -DCIRCUITPY_BLEIO=$(CIRCUITPY_BLEIO)
+
+ifndef CIRCUITPY_BOARD
+CIRCUITPY_BOARD = 1
+endif
+CFLAGS += -DCIRCUITPY_BOARD=$(CIRCUITPY_BOARD)
+
+ifndef CIRCUITPY_BUSIO
+CIRCUITPY_BUSIO = 1
+endif
+CFLAGS += -DCIRCUITPY_BUSIO=$(CIRCUITPY_BUSIO)
+
+ifndef CIRCUITPY_DIGITALIO
+CIRCUITPY_DIGITALIO = 1
+endif
+CFLAGS += -DCIRCUITPY_DIGITALIO=$(CIRCUITPY_DIGITALIO)
+
+ifndef CIRCUITPY_DISPLAYIO
+CIRCUITPY_DISPLAYIO = $(CIRCUITPY_FULL_BUILD)
+endif
+CFLAGS += -DCIRCUITPY_DISPLAYIO=$(CIRCUITPY_DISPLAYIO)
+
+ifndef CIRCUITPY_GAMEPAD
+CIRCUITPY_GAMEPAD = $(CIRCUITPY_FULL_BUILD)
+endif
+CFLAGS += -DCIRCUITPY_GAMEPAD=$(CIRCUITPY_GAMEPAD)
+
+ifndef CIRCUITPY_I2CSLAVE
+CIRCUITPY_I2CSLAVE = $(CIRCUITPY_FULL_BUILD)
+endif
+CFLAGS += -DCIRCUITPY_I2CSLAVE=$(CIRCUITPY_I2CSLAVE)
+
+ifndef CIRCUITPY_MATH
+CIRCUITPY_MATH = 1
+endif
+CFLAGS += -DCIRCUITPY_MATH=$(CIRCUITPY_MATH)
+
+ifndef CIRCUITPY_MICROCONTROLLER
+CIRCUITPY_MICROCONTROLLER = 1
+endif
+CFLAGS += -DCIRCUITPY_MICROCONTROLLER=$(CIRCUITPY_MICROCONTROLLER)
+
+ifndef CIRCUITPY_NEOPIXEL_WRITE
+CIRCUITPY_NEOPIXEL_WRITE = 1
+endif
+CFLAGS += -DCIRCUITPY_NEOPIXEL_WRITE=$(CIRCUITPY_NEOPIXEL_WRITE)
+
+# Only certain boards support NETWORK (Ethernet)
+ifndef CIRCUITPY_NETWORK
+CIRCUITPY_NETWORK = 0
+endif
+CFLAGS += -DCIRCUITPY_NETWORK=$(CIRCUITPY_NETWORK)
+
+ifndef CIRCUITPY_NVM
+CIRCUITPY_NVM = 1
+endif
+CFLAGS += -DCIRCUITPY_NVM=$(CIRCUITPY_NVM)
+
+ifndef CIRCUITPY_OS
+CIRCUITPY_OS = 1
+endif
+CFLAGS += -DCIRCUITPY_OS=$(CIRCUITPY_OS)
+
+ifndef CIRCUITPY_PIXELBUF
+CIRCUITPY_PIXELBUF = $(CIRCUITPY_FULL_BUILD)
+endif
+CFLAGS += -DCIRCUITPY_PIXELBUF=$(CIRCUITPY_PIXELBUF)
+
+ifndef CIRCUITPY_PULSEIO
+CIRCUITPY_PULSEIO = 1
+endif
+CFLAGS += -DCIRCUITPY_PULSEIO=$(CIRCUITPY_PULSEIO)
+
+ifndef CIRCUITPY_RANDOM
+CIRCUITPY_RANDOM = 1
+endif
+CFLAGS += -DCIRCUITPY_RANDOM=$(CIRCUITPY_RANDOM)
+
+ifndef CIRCUITPY_ROTARYIO
+CIRCUITPY_ROTARYIO = 1
+endif
+CFLAGS += -DCIRCUITPY_ROTARYIO=$(CIRCUITPY_ROTARYIO)
+
+ifndef CIRCUITPY_RTC
+CIRCUITPY_RTC = 1
+endif
+CFLAGS += -DCIRCUITPY_RTC=$(CIRCUITPY_RTC)
+
+# Only for SAMD chips.
+ifndef CIRCUITPY_SAMD
+ifneq ($(findstring sam,$(CHIP_FAMILY)),)
+CIRCUITPY_SAMD = $(CIRCUITPY_FULL_BUILD)
+else
+# Not a SAMD build.
+CIRCUITPY_SAMD = 0
+endif
+endif
+CFLAGS += -DCIRCUITPY_SAMD=$(CIRCUITPY_SAMD)
+
+# Currently always off.
+ifndef CIRCUITPY_STAGE
+CIRCUITPY_STAGE = 0
+endif
+CFLAGS += -DCIRCUITPY_STAGE=$(CIRCUITPY_STAGE)
+
+ifndef CIRCUITPY_STORAGE
+CIRCUITPY_STORAGE = 1
+endif
+CFLAGS += -DCIRCUITPY_STORAGE=$(CIRCUITPY_STORAGE)
+
+ifndef CIRCUITPY_STRUCT
+CIRCUITPY_STRUCT = 1
+endif
+CFLAGS += -DCIRCUITPY_STRUCT=$(CIRCUITPY_STRUCT)
+
+ifndef CIRCUITPY_SUPERVISOR
+CIRCUITPY_SUPERVISOR = 1
+endif
+CFLAGS += -DCIRCUITPY_SUPERVISOR=$(CIRCUITPY_SUPERVISOR)
+
+ifndef CIRCUITPY_TIME
+CIRCUITPY_TIME = 1
+endif
+CFLAGS += -DCIRCUITPY_TIME=$(CIRCUITPY_TIME)
+
+ifndef CIRCUITPY_TOUCHIO
+CIRCUITPY_TOUCHIO = 1
+endif
+CFLAGS += -DCIRCUITPY_TOUCHIO=$(CIRCUITPY_TOUCHIO)
+
+# For debugging.
+ifndef CIRCUITPY_UHEAP
+CIRCUITPY_UHEAP = 0
+endif
+CFLAGS += -DCIRCUITPY_UHEAP=$(CIRCUITPY_UHEAP)
+
+ifndef CIRCUITPY_USB_HID
+CIRCUITPY_USB_HID = 1
+endif
+CFLAGS += -DCIRCUITPY_USB_HID=$(CIRCUITPY_USB_HID)
+
+ifndef CIRCUITPY_USB_MIDI
+CIRCUITPY_USB_MIDI = 1
+endif
+CFLAGS += -DCIRCUITPY_USB_MIDI=$(CIRCUITPY_USB_MIDI)
+
+# For debugging.
+ifndef CIRCUITPY_USTACK
+CIRCUITPY_USTACK = 0
+endif
+CFLAGS += -DCIRCUITPY_USTACK=$(CIRCUITPY_USTACK)
diff --git a/shared-bindings/bleio/Address.c b/shared-bindings/bleio/Address.c
index 6cf495d83..b7c76b7b2 100644
--- a/shared-bindings/bleio/Address.c
+++ b/shared-bindings/bleio/Address.c
@@ -88,7 +88,7 @@ STATIC mp_obj_t bleio_address_make_new(const mp_obj_type_t *type, size_t n_args,
GET_STR_DATA_LEN(address, str, str_len);
size_t value_index = 0;
- size_t str_index = str_len;
+ int str_index = str_len;
bool error = false;
// Loop until fewer than two characters left.
@@ -138,7 +138,7 @@ STATIC mp_obj_t bleio_address_make_new(const mp_obj_type_t *type, size_t n_args,
STATIC void bleio_address_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
bleio_address_obj_t *self = MP_OBJ_TO_PTR(self_in);
- mp_printf(print, "Address('"HEX2_FMT":"HEX2_FMT":"HEX2_FMT":"HEX2_FMT":"HEX2_FMT":"HEX2_FMT"')",
+ mp_printf(print, "Address('%02x:%02x:%02x:%02x:%02x:%02x')",
self->value[5], self->value[4], self->value[3],
self->value[2], self->value[1], self->value[0]);
}
diff --git a/shared-bindings/bleio/ScanEntry.c b/shared-bindings/bleio/ScanEntry.c
index b4a3c5504..3a57711ae 100644
--- a/shared-bindings/bleio/ScanEntry.c
+++ b/shared-bindings/bleio/ScanEntry.c
@@ -108,7 +108,7 @@ STATIC mp_obj_t scanentry_get_name(mp_obj_t self_in);
STATIC void bleio_scanentry_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
bleio_scanentry_obj_t *self = (bleio_scanentry_obj_t *)self_in;
- mp_printf(print, "ScanEntry(address: "HEX2_FMT":"HEX2_FMT":"HEX2_FMT":"HEX2_FMT":"HEX2_FMT":"HEX2_FMT"",
+ mp_printf(print, "ScanEntry(address: %02x:%02x:%02x:%02x:%02x:%02x",
self->address.value[5], self->address.value[4], self->address.value[3],
self->address.value[1], self->address.value[1], self->address.value[0]);
diff --git a/shared-bindings/bleio/UUID.c b/shared-bindings/bleio/UUID.c
index 8b868a1ae..c6ad9e626 100644
--- a/shared-bindings/bleio/UUID.c
+++ b/shared-bindings/bleio/UUID.c
@@ -79,7 +79,7 @@ STATIC mp_obj_t bleio_uuid_make_new(const mp_obj_type_t *type, size_t n_args, co
len == 36 && chars[8] == '-' && chars[13] == '-' && chars[18] == '-' && chars[23] == '-';
if (good_uuid) {
size_t hex_idx = 0;
- for (int i = 0; i < len; i++) {
+ for (size_t i = 0; i < len; i++) {
if (unichar_isxdigit(chars[i])) {
hex[hex_idx] = chars[i];
hex_idx++;
diff --git a/shared-bindings/network/__init__.c b/shared-bindings/network/__init__.c
index 69f8bea60..1067ea549 100644
--- a/shared-bindings/network/__init__.c
+++ b/shared-bindings/network/__init__.c
@@ -36,7 +36,7 @@
#include "shared-bindings/network/__init__.h"
-#if MICROPY_PY_NETWORK
+#if CIRCUITPY_NETWORK
//| :mod:`network` --- Network Interface Management
//| ===============================================
@@ -71,4 +71,4 @@ const mp_obj_module_t network_module = {
.globals = (mp_obj_dict_t*)&mp_module_network_globals,
};
-#endif // MICROPY_PY_NETWORK
+#endif // CIRCUITPY_NETWORK
diff --git a/shared-bindings/nvm/__init__.c b/shared-bindings/nvm/__init__.c
index ef5c7ccb3..811855c09 100644
--- a/shared-bindings/nvm/__init__.c
+++ b/shared-bindings/nvm/__init__.c
@@ -55,8 +55,7 @@ STATIC const mp_rom_map_elem_t nvm_module_globals_table[] = {
STATIC MP_DEFINE_CONST_DICT(nvm_module_globals, nvm_module_globals_table);
-// cpy prefix is used to prevent collision with nvm_module global in ASF.
-const mp_obj_module_t cpy_nvm_module = {
+const mp_obj_module_t nvm_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t*)&nvm_module_globals,
};
diff --git a/supervisor/port.h b/supervisor/port.h
index 59898c8e4..1430c6a50 100644
--- a/supervisor/port.h
+++ b/supervisor/port.h
@@ -29,10 +29,6 @@
#include "py/mpconfig.h"
-#ifndef PORT_HEAP_SIZE
-#error "Please define PORT_HEAP_SIZE to specify heap size in bytes."
-#endif
-
#include "supervisor/shared/safe_mode.h"
// Provided by the linker;