merge from upstream; WIP redo Address; no more AddressType

This commit is contained in:
Dan Halbert 2019-06-13 21:55:07 -04:00
commit bed6d43a76
175 changed files with 3355 additions and 1230 deletions

3
.gitignore vendored
View File

@ -12,6 +12,8 @@
# Packages
############
dist/
*.egg-info
# Logs and Databases
######################
@ -25,6 +27,7 @@
######################
build/
bin/
circuitpython-stubs/
# Test failure outputs
######################

View File

@ -21,7 +21,7 @@ git:
# that SDK is shortest and add it there. In the case of major re-organizations,
# just try to make the builds "about equal in run time"
env:
- TRAVIS_TESTS="unix docs translations website" TRAVIS_BOARDS="circuitplayground_express mini_sam_m4 grandcentral_m4_express capablerobot_usbhub pca10056 pca10059 feather_nrf52840_express makerdiary_nrf52840_mdk makerdiary_nrf52840_mdk_usb_dongle particle_boron particle_argon particle_xenon sparkfun_nrf52840_mini electronut_labs_papyr" TRAVIS_SDK=arm:nrf
- TRAVIS_TESTS="unix docs translations website" TRAVIS_BOARDS="circuitplayground_express mini_sam_m4 grandcentral_m4_express capablerobot_usbhub pygamer pca10056 pca10059 feather_nrf52840_express makerdiary_nrf52840_mdk makerdiary_nrf52840_mdk_usb_dongle particle_boron particle_argon particle_xenon sparkfun_nrf52840_mini electronut_labs_papyr electronut_labs_blip" TRAVIS_SDK=arm:nrf
- TRAVIS_BOARDS="metro_m0_express metro_m4_express metro_m4_airlift_lite pirkey_m0 trellis_m4_express trinket_m0 sparkfun_lumidrive sparkfun_redboard_turbo bast_pro_mini_m0" TRAVIS_SDK=arm
- TRAVIS_BOARDS="feather_radiofruit_zigbee gemma_m0 hallowing_m0_express itsybitsy_m0_express itsybitsy_m4_express meowmeow sam32 uchip escornabot_makech" TRAVIS_SDK=arm
- TRAVIS_BOARDS="feather_m0_express_crickit feather_m0_rfm69 feather_m0_rfm9x feather_m4_express arduino_zero arduino_mkr1300 arduino_mkrzero pewpew10 kicksat-sprite ugame10 robohatmm1" TRAVIS_SDK=arm

View File

@ -1,4 +1,4 @@
# Makefile for Sphinx documentation
# Top-level Makefile for documentation builds and miscellaneous tasks.
#
# You can set these variables from the command line.
@ -17,6 +17,13 @@ CONFDIR = .
FORCE = -E
VERBOSE = -v
# path to generated type stubs
STUBDIR = circuitpython-stubs
# Run "make VALIDATE= stubs" to avoid validating generated stub files
VALIDATE = -v
# path to pypi source distributions
DISTDIR = dist
# Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the
# full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the
# executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
@ -31,7 +38,7 @@ I18NSPHINXOPTS = $(BASEOPTS)
TRANSLATE_SOURCES = extmod lib main.c ports/atmel-samd ports/nrf py shared-bindings shared-module supervisor
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext stubs
help:
@echo "Please use \`make <target>' where <target> is one of"
@ -60,6 +67,7 @@ help:
clean:
rm -rf $(BUILDDIR)/*
rm -rf $(STUBDIR) $(DISTDIR) *.egg-info
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@ -203,3 +211,11 @@ translate: locale/circuitpython.pot
check-translate: locale/circuitpython.pot $(wildcard locale/*.po)
$(PYTHON) tools/check_translations.py $^
stubs:
rst2pyi $(VALIDATE) shared-bindings/ $(STUBDIR)
python setup.py sdist
update-frozen-libraries:
@echo "Updating all frozen libraries to latest tagged version."
cd frozen; for library in *; do cd $$library; ../../tools/git-checkout-latest-tag.sh; cd ..; done

View File

@ -115,8 +115,8 @@ Behavior
output is written to ``boot_out.txt``.
- ``code.py`` (or ``main.py``) is run after every reload until it
finishes or is interrupted. After it is done running, the vm and
hardware is reinitialized. **This means you cannot read state from
``code.py`` in the REPL anymore.** CircuitPython's goal for this
hardware is reinitialized. **This means you cannot read state from**
``code.py`` **in the REPL anymore.** CircuitPython's goal for this
change includes reduce confusion about pins and memory being used.
- After ``code.py`` the REPL can be entered by pressing any key. It no
longer shares state with ``code.py`` so it is a fresh vm.
@ -131,9 +131,9 @@ Behavior
``samd.disable_autoreload()``)
- Entering the REPL after the main code is finished requires a key press which enters the REPL and
disables autoreload.
- Main is one of these: ``code.txt``, **``code.py``**, ``main.py``,
- Main is one of these: ``code.txt``, ``code.py``, ``main.py``,
``main.txt``
- Boot is one of these: ``settings.txt``, ``settings.py``, **``boot.py``**,
- Boot is one of these: ``settings.txt``, ``settings.py``, ``boot.py``,
``boot.txt``
API

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-13 17:34-0700\n"
"POT-Creation-Date: 2019-06-11 14:59-0700\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"
@ -518,6 +518,7 @@ msgid "Drive mode not used when direction is input."
msgstr ""
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "EXTINT channel already in use"
msgstr "Channel EXTINT sedang digunakan"
@ -546,6 +547,10 @@ msgstr ""
msgid "Expected tuple of length %d, got %d"
msgstr ""
#: shared-bindings/ps2io/Ps2.c
msgid "Failed sending command."
msgstr ""
#: ports/nrf/common-hal/bleio/Device.c
#, fuzzy
msgid "Failed to acquire mutex"
@ -851,6 +856,10 @@ msgstr ""
msgid "LHS of keyword arg must be an id"
msgstr "LHS dari keyword arg harus menjadi sebuah id"
#: shared-module/displayio/Group.c
msgid "Layer already in a group."
msgstr ""
#: shared-module/displayio/Group.c
msgid "Layer must be a Group or TileGrid subclass."
msgstr ""
@ -932,6 +941,10 @@ msgstr "Tidak ada GCLK yang kosong"
msgid "No hardware random available"
msgstr ""
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
msgid "No hardware support on clk pin"
msgstr ""
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "No hardware support on pin"
@ -1015,6 +1028,10 @@ msgstr ""
msgid "Plus any modules on the filesystem\n"
msgstr "Tambahkan module apapun pada filesystem\n"
#: shared-bindings/ps2io/Ps2.c
msgid "Pop from an empty Ps2 buffer"
msgstr ""
#: main.c
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr ""
@ -2176,7 +2193,7 @@ msgstr ""
msgid "object not callable"
msgstr ""
#: py/sequence.c
#: py/sequence.c shared-bindings/displayio/Group.c
msgid "object not in sequence"
msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-13 17:41-0700\n"
"POT-Creation-Date: 2019-06-12 00:59-0700\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"
@ -506,6 +506,7 @@ msgid "Drive mode not used when direction is input."
msgstr ""
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "EXTINT channel already in use"
msgstr ""
@ -534,6 +535,10 @@ msgstr ""
msgid "Expected tuple of length %d, got %d"
msgstr ""
#: shared-bindings/ps2io/Ps2.c
msgid "Failed sending command."
msgstr ""
#: ports/nrf/common-hal/bleio/Device.c
msgid "Failed to acquire mutex"
msgstr ""
@ -826,6 +831,10 @@ msgstr ""
msgid "LHS of keyword arg must be an id"
msgstr ""
#: shared-module/displayio/Group.c
msgid "Layer already in a group."
msgstr ""
#: shared-module/displayio/Group.c
msgid "Layer must be a Group or TileGrid subclass."
msgstr ""
@ -907,6 +916,10 @@ msgstr ""
msgid "No hardware random available"
msgstr ""
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
msgid "No hardware support on clk pin"
msgstr ""
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "No hardware support on pin"
@ -989,6 +1002,10 @@ msgstr ""
msgid "Plus any modules on the filesystem\n"
msgstr ""
#: shared-bindings/ps2io/Ps2.c
msgid "Pop from an empty Ps2 buffer"
msgstr ""
#: main.c
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr ""
@ -2131,7 +2148,7 @@ msgstr ""
msgid "object not callable"
msgstr ""
#: py/sequence.c
#: py/sequence.c shared-bindings/displayio/Group.c
msgid "object not in sequence"
msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-13 17:34-0700\n"
"POT-Creation-Date: 2019-06-11 14:59-0700\n"
"PO-Revision-Date: 2018-07-27 11:55-0700\n"
"Last-Translator: Pascal Deneaux\n"
"Language-Team: Sebastian Plamauer, Pascal Deneaux\n"
@ -510,6 +510,7 @@ msgid "Drive mode not used when direction is input."
msgstr "Drive mode wird nicht verwendet, wenn die Richtung input ist."
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "EXTINT channel already in use"
msgstr "EXTINT Kanal ist schon in Benutzung"
@ -538,6 +539,10 @@ msgstr "Eine UUID wird erwartet"
msgid "Expected tuple of length %d, got %d"
msgstr "Habe ein Tupel der Länge %d erwartet aber %d erhalten"
#: shared-bindings/ps2io/Ps2.c
msgid "Failed sending command."
msgstr ""
#: ports/nrf/common-hal/bleio/Device.c
msgid "Failed to acquire mutex"
msgstr "Akquirieren des Mutex gescheitert"
@ -832,6 +837,10 @@ msgstr "Ungültige wave Datei"
msgid "LHS of keyword arg must be an id"
msgstr "LHS des Schlüsselwortarguments muss eine id sein"
#: shared-module/displayio/Group.c
msgid "Layer already in a group."
msgstr ""
#: shared-module/displayio/Group.c
msgid "Layer must be a Group or TileGrid subclass."
msgstr "Layer muss eine Group- oder TileGrid-Unterklasse sein."
@ -920,6 +929,10 @@ msgstr "Keine freien GCLKs"
msgid "No hardware random available"
msgstr "Kein hardware random verfügbar"
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
msgid "No hardware support on clk pin"
msgstr ""
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "No hardware support on pin"
@ -1004,6 +1017,10 @@ msgstr "Pixel außerhalb der Puffergrenzen"
msgid "Plus any modules on the filesystem\n"
msgstr "und alle Module im Dateisystem \n"
#: shared-bindings/ps2io/Ps2.c
msgid "Pop from an empty Ps2 buffer"
msgstr ""
#: main.c
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr ""
@ -2178,7 +2195,7 @@ msgstr "Objekt ist kein Iterator"
msgid "object not callable"
msgstr ""
#: py/sequence.c
#: py/sequence.c shared-bindings/displayio/Group.c
msgid "object not in sequence"
msgstr "Objekt ist nicht in sequence"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-13 17:34-0700\n"
"POT-Creation-Date: 2019-06-11 14:59-0700\n"
"PO-Revision-Date: 2018-07-27 11:55-0700\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -506,6 +506,7 @@ msgid "Drive mode not used when direction is input."
msgstr ""
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "EXTINT channel already in use"
msgstr ""
@ -534,6 +535,10 @@ msgstr ""
msgid "Expected tuple of length %d, got %d"
msgstr ""
#: shared-bindings/ps2io/Ps2.c
msgid "Failed sending command."
msgstr ""
#: ports/nrf/common-hal/bleio/Device.c
msgid "Failed to acquire mutex"
msgstr ""
@ -826,6 +831,10 @@ msgstr ""
msgid "LHS of keyword arg must be an id"
msgstr ""
#: shared-module/displayio/Group.c
msgid "Layer already in a group."
msgstr ""
#: shared-module/displayio/Group.c
msgid "Layer must be a Group or TileGrid subclass."
msgstr ""
@ -907,6 +916,10 @@ msgstr ""
msgid "No hardware random available"
msgstr ""
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
msgid "No hardware support on clk pin"
msgstr ""
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "No hardware support on pin"
@ -989,6 +1002,10 @@ msgstr ""
msgid "Plus any modules on the filesystem\n"
msgstr ""
#: shared-bindings/ps2io/Ps2.c
msgid "Pop from an empty Ps2 buffer"
msgstr ""
#: main.c
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr ""
@ -2131,7 +2148,7 @@ msgstr ""
msgid "object not callable"
msgstr ""
#: py/sequence.c
#: py/sequence.c shared-bindings/displayio/Group.c
msgid "object not in sequence"
msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-13 17:34-0700\n"
"POT-Creation-Date: 2019-06-11 14:59-0700\n"
"PO-Revision-Date: 2018-07-27 11:55-0700\n"
"Last-Translator: \n"
"Language-Team: @sommersoft, @MrCertainly\n"
@ -510,6 +510,7 @@ msgid "Drive mode not used when direction is input."
msgstr ""
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "EXTINT channel already in use"
msgstr "Avast! EXTINT channel already in use"
@ -538,6 +539,10 @@ msgstr ""
msgid "Expected tuple of length %d, got %d"
msgstr ""
#: shared-bindings/ps2io/Ps2.c
msgid "Failed sending command."
msgstr ""
#: ports/nrf/common-hal/bleio/Device.c
msgid "Failed to acquire mutex"
msgstr ""
@ -830,6 +835,10 @@ msgstr ""
msgid "LHS of keyword arg must be an id"
msgstr ""
#: shared-module/displayio/Group.c
msgid "Layer already in a group."
msgstr ""
#: shared-module/displayio/Group.c
msgid "Layer must be a Group or TileGrid subclass."
msgstr ""
@ -911,6 +920,10 @@ msgstr ""
msgid "No hardware random available"
msgstr ""
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
msgid "No hardware support on clk pin"
msgstr ""
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "No hardware support on pin"
@ -993,6 +1006,10 @@ msgstr ""
msgid "Plus any modules on the filesystem\n"
msgstr ""
#: shared-bindings/ps2io/Ps2.c
msgid "Pop from an empty Ps2 buffer"
msgstr ""
#: main.c
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr ""
@ -2135,7 +2152,7 @@ msgstr ""
msgid "object not callable"
msgstr ""
#: py/sequence.c
#: py/sequence.c shared-bindings/displayio/Group.c
msgid "object not in sequence"
msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-13 17:34-0700\n"
"POT-Creation-Date: 2019-06-11 14:59-0700\n"
"PO-Revision-Date: 2018-08-24 22:56-0500\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -524,6 +524,7 @@ msgid "Drive mode not used when direction is input."
msgstr "Modo Drive no se usa cuando la dirección es input."
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "EXTINT channel already in use"
msgstr "El canal EXTINT ya está siendo utilizado"
@ -554,6 +555,10 @@ msgstr "Se espera un %q"
msgid "Expected tuple of length %d, got %d"
msgstr "Se esperaba un tuple de %d, se obtuvo %d"
#: shared-bindings/ps2io/Ps2.c
msgid "Failed sending command."
msgstr ""
#: ports/nrf/common-hal/bleio/Device.c
#, fuzzy
msgid "Failed to acquire mutex"
@ -861,6 +866,10 @@ msgstr "Archivo wave inválido"
msgid "LHS of keyword arg must be an id"
msgstr "LHS del agumento por palabra clave deberia ser un identificador"
#: shared-module/displayio/Group.c
msgid "Layer already in a group."
msgstr ""
#: shared-module/displayio/Group.c
msgid "Layer must be a Group or TileGrid subclass."
msgstr "Layer debe ser una subclase de Group o TileGrid."
@ -946,6 +955,10 @@ msgstr "Sin GCLKs libres"
msgid "No hardware random available"
msgstr "No hay hardware random disponible"
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
msgid "No hardware support on clk pin"
msgstr ""
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "No hardware support on pin"
@ -1035,6 +1048,10 @@ msgstr ""
msgid "Plus any modules on the filesystem\n"
msgstr "Incapaz de montar de nuevo el sistema de archivos"
#: shared-bindings/ps2io/Ps2.c
msgid "Pop from an empty Ps2 buffer"
msgstr ""
#: main.c
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr ""
@ -2213,7 +2230,7 @@ msgstr "objeto no es un iterator"
msgid "object not callable"
msgstr "objeto no puede ser llamado"
#: py/sequence.c
#: py/sequence.c shared-bindings/displayio/Group.c
msgid "object not in sequence"
msgstr "objeto no en secuencia"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-13 17:34-0700\n"
"POT-Creation-Date: 2019-06-11 14:59-0700\n"
"PO-Revision-Date: 2018-12-20 22:15-0800\n"
"Last-Translator: Timothy <me@timothygarcia.ca>\n"
"Language-Team: fil\n"
@ -519,6 +519,7 @@ msgid "Drive mode not used when direction is input."
msgstr "Drive mode ay hindi ginagamit kapag ang direksyon ay input."
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "EXTINT channel already in use"
msgstr "Ginagamit na ang EXTINT channel"
@ -549,6 +550,10 @@ msgstr "Umasa ng %q"
msgid "Expected tuple of length %d, got %d"
msgstr ""
#: shared-bindings/ps2io/Ps2.c
msgid "Failed sending command."
msgstr ""
#: ports/nrf/common-hal/bleio/Device.c
#, fuzzy
msgid "Failed to acquire mutex"
@ -856,6 +861,10 @@ msgstr "May hindi tama sa wave file"
msgid "LHS of keyword arg must be an id"
msgstr "LHS ng keyword arg ay dapat na id"
#: shared-module/displayio/Group.c
msgid "Layer already in a group."
msgstr ""
#: shared-module/displayio/Group.c
msgid "Layer must be a Group or TileGrid subclass."
msgstr ""
@ -941,6 +950,10 @@ msgstr "Walang libreng GCLKs"
msgid "No hardware random available"
msgstr "Walang magagamit na hardware random"
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
msgid "No hardware support on clk pin"
msgstr ""
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "No hardware support on pin"
@ -1028,6 +1041,10 @@ msgstr ""
msgid "Plus any modules on the filesystem\n"
msgstr "Kasama ang kung ano pang modules na sa filesystem\n"
#: shared-bindings/ps2io/Ps2.c
msgid "Pop from an empty Ps2 buffer"
msgstr ""
#: main.c
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr ""
@ -2212,7 +2229,7 @@ msgstr "object ay hindi iterator"
msgid "object not callable"
msgstr "hindi matatawag ang object"
#: py/sequence.c
#: py/sequence.c shared-bindings/displayio/Group.c
msgid "object not in sequence"
msgstr "object wala sa sequence"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-13 17:34-0700\n"
"POT-Creation-Date: 2019-06-11 14:59-0700\n"
"PO-Revision-Date: 2019-04-14 20:05+0100\n"
"Last-Translator: Pierrick Couturier <arofarn@arofarn.info>\n"
"Language-Team: fr\n"
@ -522,6 +522,7 @@ msgid "Drive mode not used when direction is input."
msgstr "Le mode Drive n'est pas utilisé quand la direction est 'input'."
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "EXTINT channel already in use"
msgstr "Canal EXTINT déjà utilisé"
@ -552,6 +553,10 @@ msgstr "Un UUID est attendu"
msgid "Expected tuple of length %d, got %d"
msgstr "Tuple de longueur %d attendu, obtenu %d"
#: shared-bindings/ps2io/Ps2.c
msgid "Failed sending command."
msgstr ""
#: ports/nrf/common-hal/bleio/Device.c
#, fuzzy
msgid "Failed to acquire mutex"
@ -864,6 +869,10 @@ msgstr "Fichier WAVE invalide"
msgid "LHS of keyword arg must be an id"
msgstr "La partie gauche de l'argument nommé doit être un identifiant"
#: shared-module/displayio/Group.c
msgid "Layer already in a group."
msgstr ""
#: shared-module/displayio/Group.c
msgid "Layer must be a Group or TileGrid subclass."
msgstr "'Layer' doit être un 'Group' ou une sous-classe 'TileGrid'."
@ -949,6 +958,10 @@ msgstr "Pas de GCLK libre"
msgid "No hardware random available"
msgstr "Pas de source matérielle d'aléa disponible"
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
msgid "No hardware support on clk pin"
msgstr ""
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "No hardware support on pin"
@ -1045,6 +1058,10 @@ msgstr "Pixel au-delà des limites du tampon"
msgid "Plus any modules on the filesystem\n"
msgstr "Ainsi que tout autre module présent sur le système de fichiers\n"
#: shared-bindings/ps2io/Ps2.c
msgid "Pop from an empty Ps2 buffer"
msgstr ""
#: main.c
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr "Appuyez sur une touche pour entrer sur REPL ou CTRL-D pour recharger."
@ -2247,7 +2264,7 @@ msgstr "l'objet n'est pas un itérateur"
msgid "object not callable"
msgstr "objet non appelable"
#: py/sequence.c
#: py/sequence.c shared-bindings/displayio/Group.c
msgid "object not in sequence"
msgstr "l'objet n'est pas dans la séquence"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-13 17:34-0700\n"
"POT-Creation-Date: 2019-06-11 14:59-0700\n"
"PO-Revision-Date: 2018-10-02 16:27+0200\n"
"Last-Translator: Enrico Paganin <enrico.paganin@mail.com>\n"
"Language-Team: \n"
@ -519,6 +519,7 @@ msgid "Drive mode not used when direction is input."
msgstr ""
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "EXTINT channel already in use"
msgstr "Canale EXTINT già in uso"
@ -549,6 +550,10 @@ msgstr "Atteso un %q"
msgid "Expected tuple of length %d, got %d"
msgstr ""
#: shared-bindings/ps2io/Ps2.c
msgid "Failed sending command."
msgstr ""
#: ports/nrf/common-hal/bleio/Device.c
#, fuzzy
msgid "Failed to acquire mutex"
@ -858,6 +863,10 @@ msgstr "File wave non valido"
msgid "LHS of keyword arg must be an id"
msgstr ""
#: shared-module/displayio/Group.c
msgid "Layer already in a group."
msgstr ""
#: shared-module/displayio/Group.c
msgid "Layer must be a Group or TileGrid subclass."
msgstr "Layer deve essere un Group o TileGrid subclass"
@ -940,6 +949,10 @@ msgstr "Nessun GCLK libero"
msgid "No hardware random available"
msgstr "Nessun generatore hardware di numeri casuali disponibile"
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
msgid "No hardware support on clk pin"
msgstr ""
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "No hardware support on pin"
@ -1033,6 +1046,10 @@ msgstr ""
msgid "Plus any modules on the filesystem\n"
msgstr "Imposssibile rimontare il filesystem"
#: shared-bindings/ps2io/Ps2.c
msgid "Pop from an empty Ps2 buffer"
msgstr ""
#: main.c
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr ""
@ -2208,7 +2225,7 @@ msgstr "l'oggetto non è un iteratore"
msgid "object not callable"
msgstr ""
#: py/sequence.c
#: py/sequence.c shared-bindings/displayio/Group.c
msgid "object not in sequence"
msgstr "oggetto non in sequenza"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-13 17:34-0700\n"
"POT-Creation-Date: 2019-06-11 14:59-0700\n"
"PO-Revision-Date: 2019-03-19 18:37-0700\n"
"Last-Translator: Radomir Dopieralski <circuitpython@sheep.art.pl>\n"
"Language-Team: pl\n"
@ -509,6 +509,7 @@ msgid "Drive mode not used when direction is input."
msgstr "Tryb sterowania nieużywany w trybie wejścia."
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "EXTINT channel already in use"
msgstr "Kanał EXTINT w użyciu"
@ -537,6 +538,10 @@ msgstr "Oczekiwano UUID"
msgid "Expected tuple of length %d, got %d"
msgstr "Oczekiwano krotkę długości %d, otrzymano %d"
#: shared-bindings/ps2io/Ps2.c
msgid "Failed sending command."
msgstr ""
#: ports/nrf/common-hal/bleio/Device.c
msgid "Failed to acquire mutex"
msgstr "Nie udało się uzyskać blokady"
@ -831,6 +836,10 @@ msgstr "Zły plik wave"
msgid "LHS of keyword arg must be an id"
msgstr "Lewa strona argumentu nazwanego musi być nazwą"
#: shared-module/displayio/Group.c
msgid "Layer already in a group."
msgstr ""
#: shared-module/displayio/Group.c
msgid "Layer must be a Group or TileGrid subclass."
msgstr "Layer musi dziedziczyć z Group albo TileGrid"
@ -917,6 +926,10 @@ msgstr "Brak wolnych GLCK"
msgid "No hardware random available"
msgstr "Brak generatora liczb losowych"
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
msgid "No hardware support on clk pin"
msgstr ""
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "No hardware support on pin"
@ -999,6 +1012,10 @@ msgstr "Piksel poza granicami bufora"
msgid "Plus any modules on the filesystem\n"
msgstr "Oraz moduły w systemie plików\n"
#: shared-bindings/ps2io/Ps2.c
msgid "Pop from an empty Ps2 buffer"
msgstr ""
#: main.c
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr "Dowolny klawisz aby uruchomić konsolę. CTRL-D aby przeładować."
@ -2156,7 +2173,7 @@ msgstr "obiekt nie jest iteratorem"
msgid "object not callable"
msgstr "obiekt nie jest wywoływalny"
#: py/sequence.c
#: py/sequence.c shared-bindings/displayio/Group.c
msgid "object not in sequence"
msgstr "obiektu nie ma sekwencji"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-13 17:34-0700\n"
"POT-Creation-Date: 2019-06-11 14:59-0700\n"
"PO-Revision-Date: 2018-10-02 21:14-0000\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -514,6 +514,7 @@ msgid "Drive mode not used when direction is input."
msgstr ""
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "EXTINT channel already in use"
msgstr "Canal EXTINT em uso"
@ -544,6 +545,10 @@ msgstr "Esperado um"
msgid "Expected tuple of length %d, got %d"
msgstr ""
#: shared-bindings/ps2io/Ps2.c
msgid "Failed sending command."
msgstr "Falha ao enviar comando."
#: ports/nrf/common-hal/bleio/Device.c
#, fuzzy
msgid "Failed to acquire mutex"
@ -849,6 +854,10 @@ msgstr "Aqruivo de ondas inválido"
msgid "LHS of keyword arg must be an id"
msgstr ""
#: shared-module/displayio/Group.c
msgid "Layer already in a group."
msgstr ""
#: shared-module/displayio/Group.c
msgid "Layer must be a Group or TileGrid subclass."
msgstr ""
@ -930,6 +939,10 @@ msgstr "Não há GCLKs livre"
msgid "No hardware random available"
msgstr ""
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
msgid "No hardware support on clk pin"
msgstr "Sem suporte de hardware no pino de clock"
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "No hardware support on pin"
@ -1016,6 +1029,10 @@ msgstr ""
msgid "Plus any modules on the filesystem\n"
msgstr "Não é possível remontar o sistema de arquivos"
#: shared-bindings/ps2io/Ps2.c
msgid "Pop from an empty Ps2 buffer"
msgstr "Buffer Ps2 vazio"
#: main.c
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr ""
@ -2165,7 +2182,7 @@ msgstr ""
msgid "object not callable"
msgstr ""
#: py/sequence.c
#: py/sequence.c shared-bindings/displayio/Group.c
msgid "object not in sequence"
msgstr "objeto não em seqüência"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: circuitpython-cn\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-13 17:34-0700\n"
"POT-Creation-Date: 2019-06-11 14:59-0700\n"
"PO-Revision-Date: 2019-04-13 10:10-0700\n"
"Last-Translator: hexthat\n"
"Language-Team: Chinese Hanyu Pinyin\n"
@ -510,6 +510,7 @@ msgid "Drive mode not used when direction is input."
msgstr "Fāngxiàng shūrù shí qūdòng móshì méiyǒu shǐyòng."
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "EXTINT channel already in use"
msgstr "EXTINT píndào yǐjīng shǐyòng"
@ -538,6 +539,10 @@ msgstr "Yùqí UUID"
msgid "Expected tuple of length %d, got %d"
msgstr "Qīwàng de chángdù wèi %d de yuán zǔ, dédào %d"
#: shared-bindings/ps2io/Ps2.c
msgid "Failed sending command."
msgstr ""
#: ports/nrf/common-hal/bleio/Device.c
msgid "Failed to acquire mutex"
msgstr "Wúfǎ huòdé mutex"
@ -832,6 +837,10 @@ msgstr "Wúxiào de làng làngcháo wénjiàn"
msgid "LHS of keyword arg must be an id"
msgstr "Guānjiàn zì arg de LHS bìxū shì id"
#: shared-module/displayio/Group.c
msgid "Layer already in a group."
msgstr ""
#: shared-module/displayio/Group.c
msgid "Layer must be a Group or TileGrid subclass."
msgstr "Layer bìxū shì Group huò TileGrid zi lèi."
@ -917,6 +926,10 @@ msgstr "Méiyǒu miǎnfèi de GCLKs"
msgid "No hardware random available"
msgstr "Méiyǒu kěyòng de yìngjiàn suíjī"
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
msgid "No hardware support on clk pin"
msgstr ""
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "No hardware support on pin"
@ -1004,6 +1017,10 @@ msgstr "Xiàngsù chāochū huǎnchōng qū biānjiè"
msgid "Plus any modules on the filesystem\n"
msgstr "Zài wénjiàn xìtǒng shàng tiānjiā rènhé mókuài\n"
#: shared-bindings/ps2io/Ps2.c
msgid "Pop from an empty Ps2 buffer"
msgstr ""
#: main.c
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr "Àn xià rènhé jiàn jìnrù REPL. Shǐyòng CTRL-D chóngxīn jiāzài."
@ -2168,7 +2185,7 @@ msgstr "duìxiàng bùshì diédài qì"
msgid "object not callable"
msgstr "duìxiàng wúfǎ diàoyòng"
#: py/sequence.c
#: py/sequence.c shared-bindings/displayio/Group.c
msgid "object not in sequence"
msgstr "duìxiàng bùshì xùliè"

5
main.c
View File

@ -455,6 +455,11 @@ void gc_collect(void) {
// This collects root pointers from the VFS mount table. Some of them may
// have lost their references in the VM even though they are mounted.
gc_collect_root((void**)&MP_STATE_VM(vfs_mount_table), sizeof(mp_vfs_mount_t) / sizeof(mp_uint_t));
#if CIRCUITPY_DISPLAYIO
displayio_gc_collect();
#endif
// This naively collects all object references from an approximate stack
// range.
gc_collect_root((void**)sp, ((uint32_t)&_estack - sp) / sizeof(uint32_t));

View File

@ -99,10 +99,9 @@ endif
#Debugging/Optimization
ifeq ($(DEBUG), 1)
# Turn on Python modules useful for debugging (e.g. uheap, ustack).
CFLAGS += -ggdb
# You may want to disable -flto if it interferes with debugging.
CFLAGS += -flto
CFLAGS += -flto -flto-partition=none
# You may want to enable these flags to make setting breakpoints easier.
# CFLAGS += -fno-inline -fno-ipa-sra
ifeq ($(CHIP_FAMILY), samd21)
@ -112,13 +111,18 @@ else
# -finline-limit can shrink the image size.
# -finline-limit=80 or so is similar to not having it on.
# There is no simple default value, though.
ifeq ($(INTERNAL_FLASH_FILESYSTEM),1)
CFLAGS += -finline-limit=50
# Do a default shrink for small builds.
ifndef CFLAGS_INLINE_LIMIT
ifeq ($(CIRCUITPY_SMALL_BUILD),1)
CFLAGS_INLINE_LIMIT = 50
endif
endif
ifdef CFLAGS_INLINE_LIMIT
CFLAGS += -finline-limit=$(CFLAGS_INLINE_LIMIT)
endif
CFLAGS += -flto
CFLAGS += -flto -flto-partition=none
endif
CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT)

View File

@ -4,9 +4,10 @@ USB_PID = 0x8053
USB_PRODUCT = "Arduino MKR1300"
USB_MANUFACTURER = "Arduino"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SUPEROPT_GC = 0

View File

@ -1,12 +1,14 @@
LD_FILE = boards/samd21x18-bootloader.ld
USB_VID = 0x239A
USB_PID = 0x8035
USB_PID = 0x8050
USB_PRODUCT = "Arduino MKRZero"
USB_MANUFACTURER = "Arduino"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SUPEROPT_GC = 0

View File

@ -4,9 +4,11 @@ USB_PID = 0x824D
USB_PRODUCT = "Arduino Zero"
USB_MANUFACTURER = "Arduino"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SUPEROPT_GC = 0

View File

@ -4,9 +4,9 @@ USB_PID = 0xBAB3
USB_PRODUCT = "Bast Pro Mini M0"
USB_MANUFACTURER = "Electronic Cats"
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21

View File

@ -4,6 +4,9 @@ USB_PID = 0xEDB3
USB_PRODUCT = "Programmable USB Hub"
USB_MANUFACTURER = "Capable Robot Components"
CHIP_VARIANT = SAMD51G19A
CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = GD25Q16C
@ -13,6 +16,3 @@ LONGINT_IMPL = MPZ
CIRCUITPY_AUDIOBUSIO = 0
# No touch on SAMD51 yet
CIRCUITPY_TOUCHIO = 0
CHIP_VARIANT = SAMD51G19A
CHIP_FAMILY = samd51

View File

@ -4,9 +4,9 @@ USB_PID = 0xBAB2
USB_PRODUCT = "CatWAN USBStick"
USB_MANUFACTURER = "Electronic Cats"
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21

View File

@ -4,6 +4,9 @@ USB_PID = 0x8019
USB_PRODUCT = "CircuitPlayground Express"
USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
@ -14,8 +17,8 @@ CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_I2CSLAVE = 0
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SUPEROPT_GC = 0
CFLAGS_INLINE_LIMIT = 55
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
@ -24,10 +27,3 @@ FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Thermistor
# Tweak inlining depending on language.
ifeq ($(TRANSLATION), zh_Latn_pinyin)
CFLAGS_INLINE_LIMIT = 35
else
CFLAGS_INLINE_LIMIT = 55
endif

View File

@ -4,26 +4,23 @@ USB_PID = 0x8019
USB_PRODUCT = "CircuitPlayground Express with Crickit libraries"
USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
# Turn off longints for Crickit build to make room for additional frozen libs.
LONGINT_IMPL = NONE
# Turn off features and optimizations for Crickit build to make room for additional frozen libs.
LONGINT_IMPL = NONE
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_PIXELBUF = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_I2CSLAVE = 0
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
# Tweak inlining depending on language.
ifeq ($(TRANSLATION), zh_Latn_pinyin)
CFLAGS_INLINE_LIMIT = 35
else
SUPEROPT_GC = 0
CFLAGS_INLINE_LIMIT = 55
endif
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice

View File

@ -4,14 +4,15 @@ USB_PID = 0x8021
USB_PRODUCT = "CP32-M4"
USB_MANUFACTURER = "Nadda-Reel Company LLC"
CHIP_VARIANT = SAMD51J20A
CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = "W25Q128JV_PM"
# No I2S on SAMD51G
CIRCUITPY_PS2IO = 1
# No I2S on SAMD51G.
CIRCUITPY_AUDIOBUSIO = 0
# No touch on SAMD51 yet
# No touch on SAMD51 yet.
CIRCUITPY_TOUCHIO = 0
CHIP_VARIANT = SAMD51J20A
CHIP_FAMILY = samd51

View File

@ -4,17 +4,16 @@ USB_PID = 0x0001
USB_PRODUCT = "Datalore IP M4"
USB_MANUFACTURER = "TG-Boards"
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 3
EXTERNAL_FLASH_DEVICES = "GD25Q16C, W25Q16JV_IQ, W25Q16JV_IM"
LONGINT_IMPL = MPZ
CHIP_VARIANT = SAMD51J19A
CHIP_FAMILY = samd51
# No touch on SAMD51 yet
CIRCUITPY_TOUCHIO = 0
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 3
EXTERNAL_FLASH_DEVICES = "GD25Q16C, W25Q16JV_IQ, W25Q16JV_IM"
LONGINT_IMPL = MPZ
CIRCUITPY_NETWORK = 1
MICROPY_PY_WIZNET5K = 5500
CIRCUITPY_PS2IO = 1
# No touch on SAMD51 yet
CIRCUITPY_TOUCHIO = 0

View File

@ -4,9 +4,11 @@ USB_PID = 0xBAB6
USB_PRODUCT = "Escornabot Makech"
USB_MANUFACTURER = "Electronic Cats"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SUPEROPT_GC = 0

View File

@ -4,9 +4,11 @@ USB_PID = 0x8015
USB_PRODUCT = "Feather M0 Adalogger"
USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SUPEROPT_GC = 0

View File

@ -4,9 +4,11 @@ USB_PID = 0x8015
USB_PRODUCT = "Feather M0"
USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SUPEROPT_GC = 0

View File

@ -4,15 +4,13 @@ USB_PID = 0x8023
USB_PRODUCT = "Feather M0 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
LONGINT_IMPL = MPZ
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
# Tweak inlining depending on language.
ifeq ($(TRANSLATION), zh_Latn_pinyin)
CFLAGS_INLINE_LIMIT = 60
endif
SUPEROPT_GC = 0

View File

@ -4,6 +4,9 @@ USB_PID = 0x8023
USB_PRODUCT = "Feather M0 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
@ -14,13 +17,8 @@ CIRCUITPY_BITBANGIO = 0
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_I2CSLAVE = 0
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
CFLAGS_INLINE_LIMIT = 50
CIRCUITPY_GAMEPAD = 0
CFLAGS_INLINE_LIMIT = 50
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice

View File

@ -4,9 +4,11 @@ USB_PID = 0x8015
USB_PRODUCT = "Feather M0 RFM69"
USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SUPEROPT_GC = 0

View File

@ -4,9 +4,11 @@ USB_PID = 0x8015
USB_PRODUCT = "Feather M0 RFM9x"
USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SUPEROPT_GC = 0

View File

@ -4,10 +4,10 @@ USB_PID = 0x8023
USB_PRODUCT = "Feather M0 Supersized"
USB_MANUFACTURER = "Dave Astels"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = "S25FL064L"
LONGINT_IMPL = MPZ
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21

View File

@ -4,17 +4,16 @@ USB_PID = 0x8026
USB_PRODUCT = "Feather M4 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"
QSPI_FLASH_FILESYSTEM = 1
CHIP_VARIANT = SAMD51J19A
CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = GD25Q16C
LONGINT_IMPL = MPZ
# No touch on SAMD51 yet
CIRCUITPY_TOUCHIO = 0
CHIP_VARIANT = SAMD51J19A
CHIP_FAMILY = samd51
CIRCUITPY_NETWORK = 1
MICROPY_PY_WIZNET5K = 5500
CIRCUITPY_PS2IO = 1
# No touch on SAMD51 yet
CIRCUITPY_TOUCHIO = 0

View File

@ -4,6 +4,9 @@ USB_PID = 0x8023
USB_PRODUCT = "Feather RadioFruit Zigbee"
USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMR21G18A
CHIP_FAMILY = samd21
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
@ -13,6 +16,3 @@ LONGINT_IMPL = MPZ
CIRCUITPY_AUDIOBUSIO = 0
# No DAC on SAMR21G
CIRCUITPY_AUDIOIO = 0
CHIP_VARIANT = SAMR21G18A
CHIP_FAMILY = samd21

View File

@ -4,9 +4,11 @@ USB_PID = 0x801D
USB_PRODUCT = "Gemma M0"
USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21
SUPEROPT_GC = 0

View File

@ -4,14 +4,14 @@ USB_PID = 0x8032
USB_PRODUCT = "Grand Central M4 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"
QSPI_FLASH_FILESYSTEM = 1
CHIP_VARIANT = SAMD51P20A
CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, GD25Q64C"
LONGINT_IMPL = MPZ
CIRCUITPY_PS2IO = 1
# No touch on SAMD51 yet
CIRCUITPY_TOUCHIO = 0
CHIP_VARIANT = SAMD51P20A
CHIP_FAMILY = samd51

View File

@ -4,6 +4,9 @@ USB_PID = 0xD1ED
USB_PRODUCT = "HalloWing M0 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, GD25Q64C"
@ -13,11 +16,7 @@ LONGINT_IMPL = MPZ
CIRCUITPY_I2CSLAVE = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_AUDIOBUSIO = 0
CFLAGS_INLINE_LIMIT = 50
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SUPEROPT_GC = 0
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice

View File

@ -4,17 +4,13 @@ USB_PID = 0x8012
USB_PRODUCT = "ItsyBitsy M0 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "W25Q16FW, GD25Q16C"
LONGINT_IMPL = MPZ
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
# Tweak inlining depending on language.
ifeq ($(TRANSLATION), zh_Latn_pinyin)
CFLAGS_INLINE_LIMIT = 45
else
CFLAGS_INLINE_LIMIT = 70
endif
CFLAGS_INLINE_LIMIT = 60
SUPEROPT_GC = 0

View File

@ -4,15 +4,16 @@ USB_PID = 0x802C
USB_PRODUCT = "ItsyBitsy M4 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD51G19A
CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = GD25Q16C
LONGINT_IMPL = MPZ
CIRCUITPY_PS2IO = 1
# No I2S on SAMD51G
CIRCUITPY_AUDIOBUSIO = 0
# No touch on SAMD51 yet
CIRCUITPY_TOUCHIO = 0
CHIP_VARIANT = SAMD51G19A
CHIP_FAMILY = samd51

View File

@ -4,14 +4,15 @@ USB_PID = 0xED94
USB_PRODUCT = "kicksat-sprite"
USB_MANUFACTURER = "maholli"
CHIP_VARIANT = SAMD51G19A
CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 0
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = MPZ
# No touch on SAMD51 yet
CIRCUITPY_TOUCHIO = 0
# Not needed.
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_DISPLAYIO = 0
CHIP_VARIANT = SAMD51G19A
CHIP_FAMILY = samd51

View File

@ -4,9 +4,11 @@ USB_PID = 0xBAB1
USB_PRODUCT = "Meow Meow"
USB_MANUFACTURER = "Electronic Cats"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SUPEROPT_GC = 0

View File

@ -4,16 +4,13 @@ USB_PID = 0x8014
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
# Tweak inlining depending on language.
ifeq ($(TRANSLATION), zh_Latn_pinyin)
CFLAGS_INLINE_LIMIT = 50
endif
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
LONGINT_IMPL = MPZ
CFLAGS_INLINE_LIMIT = 60
SUPEROPT_GC = 0

View File

@ -4,17 +4,16 @@ USB_PID = 0x8038
USB_PRODUCT = "Metro M4 Airlift Lite"
USB_MANUFACTURER = "Adafruit Industries LLC"
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 3
EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C"
LONGINT_IMPL = MPZ
# No touch on SAMD51 yet
CIRCUITPY_TOUCHIO = 0
CHIP_VARIANT = SAMD51J19A
CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 3
EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C"
LONGINT_IMPL = MPZ
CIRCUITPY_NETWORK = 1
MICROPY_PY_WIZNET5K = 5500
CIRCUITPY_PS2IO = 1
# No touch on SAMD51 yet
CIRCUITPY_TOUCHIO = 0

View File

@ -4,17 +4,16 @@ USB_PID = 0x8021
USB_PRODUCT = "Metro M4 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 3
EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C"
LONGINT_IMPL = MPZ
# No touch on SAMD51 yet
CIRCUITPY_TOUCHIO = 0
CHIP_VARIANT = SAMD51J19A
CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 3
EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C"
LONGINT_IMPL = MPZ
CIRCUITPY_NETWORK = 1
MICROPY_PY_WIZNET5K = 5500
CIRCUITPY_PS2IO = 1
# No touch on SAMD51 yet
CIRCUITPY_TOUCHIO = 0

View File

@ -4,16 +4,16 @@ USB_PID = 0x2017
USB_PRODUCT = "Mini SAM M4"
USB_MANUFACTURER = "Benjamin Shockley"
CHIP_VARIANT = SAMD51G19A
CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = "W25Q16JV_IM"
LONGINT_IMPL = MPZ
CIRCUITPY_PS2IO = 1
# No I2S on SAMD51G
CIRCUITPY_AUDIOBUSIO = 0
# No touch on SAMD51 yet
CIRCUITPY_TOUCHIO = 0
CHIP_VARIANT = SAMD51G19A
CHIP_FAMILY = samd51

View File

@ -4,13 +4,12 @@ USB_PID = 0x801D
USB_PRODUCT = "PewPew 10.2"
USB_MANUFACTURER = "Radomir Dopieralski"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21
FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-standalone-10.x
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_PEW = 1
CIRCUITPY_ANALOGIO = 1
@ -20,9 +19,7 @@ CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RTC = 0
CIRCUITPY_SAMD = 0
CIRCUITPY_USB_MIDI = 0
CIRCUITPY_SMALL_BUILD = 1
# Tweak inlining depending on language.
ifeq ($(TRANSLATION), zh_Latn_pinyin)
CFLAGS_INLINE_LIMIT = 40
endif
SUPEROPT_GC = 0
FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-standalone-10.x

View File

@ -4,6 +4,9 @@ USB_PID = 0x8028
USB_PRODUCT = "pIRKey M0"
USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
@ -19,11 +22,8 @@ CIRCUITPY_SAMD = 0
CIRCUITPY_USB_MIDI = 1
CIRCUITPY_TOUCHIO = 0
CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21
CFLAGS_INLINE_LIMIT = 25
# Make more room.
SUPEROPT_GC = 0
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar

View File

@ -87,8 +87,8 @@ void board_init(void) {
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,
160, // Width
128, // Height
160, // Width (after rotation)
128, // Height (after rotation)
0, // column start
0, // row start
270, // rotation

View File

@ -1,25 +1,23 @@
LD_FILE = boards/samd51x19-bootloader-external-flash.ld
USB_VID = 0x239A
USB_PID = 0x802C
USB_PID = 0x8034
USB_PRODUCT = "PyBadge"
USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD51J19A
CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = GD25Q16C
LONGINT_IMPL = MPZ
CIRCUITPY_AUDIOIO = 1
CIRCUITPY_DISPLAYIO = 1
CIRCUITPY_GAMEPAD = 1
CIRCUITPY_GAMEPADSHIFT = 1
CIRCUITPY_STAGE = 1
# No touch on SAMD51 yet
CIRCUITPY_TOUCHIO = 0
CIRCUITPY_GAMEPADSHIFT = 1
CHIP_VARIANT = SAMD51J19A
CHIP_FAMILY = samd51
CIRCUITPY_STAGE = 1
CIRCUITPY_GAMEPAD = 1
CIRCUITPY_DISPLAYIO = 1
CIRCUITPY_AUDIOIO = 1
FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pybadge

View File

@ -1,25 +1,23 @@
LD_FILE = boards/samd51x19-bootloader-external-flash.ld
USB_VID = 0x239A
USB_PID = 0x802E
USB_PID = 0x803E
USB_PRODUCT = "PyGamer"
USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD51J19A
CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = GD25Q64C
LONGINT_IMPL = MPZ
CIRCUITPY_AUDIOIO = 1
CIRCUITPY_DISPLAYIO = 1
CIRCUITPY_GAMEPAD = 1
CIRCUITPY_GAMEPADSHIFT = 1
CIRCUITPY_STAGE = 1
# No touch on SAMD51 yet
CIRCUITPY_TOUCHIO = 0
CIRCUITPY_GAMEPADSHIFT = 1
CHIP_VARIANT = SAMD51J19A
CHIP_FAMILY = samd51
CIRCUITPY_STAGE = 1
CIRCUITPY_GAMEPAD = 1
CIRCUITPY_DISPLAYIO = 1
CIRCUITPY_AUDIOIO = 1
FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pybadge

View File

@ -43,6 +43,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB22) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB23) },
// SDCS, dup of D4
{ MP_OBJ_NEW_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PA14) },
// Special named pins
{ MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA15) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_LIGHT), MP_ROM_PTR(&pin_PB04) },

View File

@ -1,17 +1,16 @@
LD_FILE = boards/samd51x20-bootloader-external-flash.ld
USB_VID = 0x239A
USB_PID = 0x8032
USB_PID = 0x8036
USB_PRODUCT = "PyPortal"
USB_MANUFACTURER = "Adafruit Industries LLC"
QSPI_FLASH_FILESYSTEM = 1
CHIP_VARIANT = SAMD51J20A
CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, GD25Q64C"
LONGINT_IMPL = MPZ
# No touch on SAMD51 yet
CIRCUITPY_TOUCHIO = 0
CHIP_VARIANT = SAMD51J20A
CHIP_FAMILY = samd51

View File

@ -4,23 +4,25 @@ USB_PID = 0x4D43
USB_PRODUCT = "Robo HAT MM1"
USB_MANUFACTURER = "Robotics Masters"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
# Non-Flash Edition
#INTERNAL_FLASH_FILESYSTEM = 1
#LONGINT_IMPL = NONE
#SUPEROPT_GC = 0
# SPI-Flash Edition
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ"
LONGINT_IMPL = MPZ
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
# Make room for frozen Libraries
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_FREQUENCYIO = 0
CFLAGS_INLINE_LIMIT = 55
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
#FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_INA219
@ -29,6 +31,3 @@ FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
#FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Crickit
#FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Motor
#FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_seesaw
#Adding per @danh to reduce memory usage and get the latest changes in
CFLAGS_INLINE_LIMIT = 55

View File

@ -4,11 +4,11 @@ USB_PID = 0xEDBE
USB_PRODUCT = "SAM32"
USB_MANUFACTURER = "maholli"
CHIP_VARIANT = SAMD51J20A
CHIP_FAMILY = samd51
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = MPZ
# No touch on SAMD51 yet
CIRCUITPY_TOUCHIO = 0
CHIP_VARIANT = SAMD51J20A
CHIP_FAMILY = samd51

View File

@ -4,16 +4,15 @@ USB_PID = 0x0017
USB_PRODUCT = "LUMIDrive Board"
USB_MANUFACTURER = "SparkFun Electronics"
SPI_FLASH_FILESYSTEM = 1
LONGINT_IMPL = MPZ
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = "W25Q32FV"
LONGINT_IMPL = MPZ
CIRCUITPY_AUDIOIO = 0
CIRCUITPY_AUDIOBUSIO = 0
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = "W25Q32FV"
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar

View File

@ -4,16 +4,13 @@ USB_PID = 0x0015
USB_PRODUCT = "RedBoard Turbo Board"
USB_MANUFACTURER = "SparkFun Electronics"
SPI_FLASH_FILESYSTEM = 1
LONGINT_IMPL = MPZ
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = "W25Q32FV"
LONGINT_IMPL = MPZ
# Tweak inlining depending on language.
ifeq ($(TRANSLATION), zh_Latn_pinyin)
CFLAGS_INLINE_LIMIT = 50
endif
CFLAGS_INLINE_LIMIT = 60
SUPEROPT_GC = 0

View File

@ -4,9 +4,11 @@ USB_PID = 0x8D23
USB_PRODUCT = "SparkFun SAMD21 Dev Breakout"
USB_MANUFACTURER = "SparkFun"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SUPEROPT_GC = 0

View File

@ -4,9 +4,11 @@ USB_PID = 0x8D22
USB_PRODUCT = "SparkFun SAMD21 Mini Breakout"
USB_MANUFACTURER = "SparkFun"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
SUPEROPT_GC = 0

View File

@ -4,15 +4,16 @@ USB_PID = 0x8030
USB_PRODUCT = "Trellis M4 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD51G19A
CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 2
EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, GD25Q64C"
LONGINT_IMPL = MPZ
CIRCUITPY_PS2IO = 1
# No I2S on SAMD51G
CIRCUITPY_AUDIOBUSIO = 0
# No touch on SAMD51 yet
CIRCUITPY_TOUCHIO = 0
CHIP_VARIANT = SAMD51G19A
CHIP_FAMILY = samd51

View File

@ -4,9 +4,11 @@ USB_PID = 0x801F
USB_PRODUCT = "Trinket M0"
USB_MANUFACTURER = "Adafruit Industries LLC"
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21
SUPEROPT_GC = 0

View File

@ -4,10 +4,10 @@ USB_PID = 0x801F
USB_PRODUCT="Trinket M0 Haxpress"
USB_MANUFACTURER="Radomir Dopieralski"
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = W25Q32BV
LONGINT_IMPL = MPZ
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21

View File

@ -4,9 +4,9 @@ USB_PID = 0xED5F
USB_PRODUCT = "uChip CircuitPython"
USB_MANUFACTURER = "Itaca Innovation"
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21

View File

@ -4,14 +4,14 @@ USB_PID = 0x801F
USB_PRODUCT = "uGame10"
USB_MANUFACTURER = "Radomir Dopieralski"
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = S25FL216K
LONGINT_IMPL = MPZ
CHIP_VARIANT = SAMD21E18A
CHIP_FAMILY = samd21
CIRCUITPY_STAGE = 1
CIRCUITPY_MATH = 1
CIRCUITPY_AUDIOIO = 1

View File

@ -0,0 +1,441 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2017-2018 Scott Shawcroft for Adafruit Industries
* Copyright (c) 2019 Elvis Pfutzenreuter <epxx@epxx.co>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "common-hal/ps2io/Ps2.h"
#include <stdint.h>
#include "atmel_start_pins.h"
#include "hal/include/hal_gpio.h"
#include "background.h"
#include "eic_handler.h"
#include "mpconfigport.h"
#include "py/gc.h"
#include "py/runtime.h"
#include "samd/external_interrupts.h"
#include "samd/pins.h"
#include "shared-bindings/microcontroller/__init__.h"
#include "shared-bindings/ps2io/Ps2.h"
#include "supervisor/shared/translate.h"
#include "tick.h"
#define STATE_IDLE 0
#define STATE_RECV 1
#define STATE_RECV_PARITY 2
#define STATE_RECV_STOP 3
#define STATE_RECV_ERR 10
#define ERROR_STARTBIT 0x01
#define ERROR_TIMEOUT 0x02
#define ERROR_PARITY 0x04
#define ERROR_STOPBIT 0x08
#define ERROR_BUFFER 0x10
#define ERROR_TX_CLKLO 0x100
#define ERROR_TX_CLKHI 0x200
#define ERROR_TX_ACKDATA 0x400
#define ERROR_TX_ACKCLK 0x800
#define ERROR_TX_RTS 0x1000
#define ERROR_TX_NORESP 0x2000
static void ps2_set_config(ps2io_ps2_obj_t* self) {
uint32_t sense_setting = EIC_CONFIG_SENSE0_FALL_Val;
set_eic_handler(self->channel, EIC_HANDLER_PS2);
turn_on_eic_channel(self->channel, sense_setting);
}
static void disable_interrupt(ps2io_ps2_obj_t* self) {
uint32_t mask = 1 << self->channel;
EIC->INTENCLR.reg = mask << EIC_INTENSET_EXTINT_Pos;
}
static void resume_interrupt(ps2io_ps2_obj_t* self) {
disable_interrupt(self);
self->state = STATE_IDLE;
gpio_set_pin_function(self->clk_pin, GPIO_PIN_FUNCTION_A);
uint32_t mask = 1 << self->channel;
EIC->INTFLAG.reg = mask << EIC_INTFLAG_EXTINT_Pos;
EIC->INTENSET.reg = mask << EIC_INTENSET_EXTINT_Pos;
ps2_set_config(self);
}
static void clk_hi(ps2io_ps2_obj_t* self) {
// External pull-up
// Must set pull after setting direction.
gpio_set_pin_direction(self->clk_pin, GPIO_DIRECTION_IN);
gpio_set_pin_pull_mode(self->clk_pin, GPIO_PULL_OFF);
}
static bool wait_clk_lo(ps2io_ps2_obj_t* self, uint32_t us) {
clk_hi(self);
common_hal_mcu_delay_us(1);
while (gpio_get_pin_level(self->clk_pin) && us) {
--us;
common_hal_mcu_delay_us(1);
}
return us;
}
static bool wait_clk_hi(ps2io_ps2_obj_t* self, uint32_t us) {
clk_hi(self);
common_hal_mcu_delay_us(1);
while (!gpio_get_pin_level(self->clk_pin) && us) {
--us;
common_hal_mcu_delay_us(1);
}
return us;
}
static void clk_lo(ps2io_ps2_obj_t* self) {
gpio_set_pin_pull_mode(self->clk_pin, GPIO_PULL_OFF);
gpio_set_pin_direction(self->clk_pin, GPIO_DIRECTION_OUT);
gpio_set_pin_level(self->clk_pin, 0);
}
static void data_hi(ps2io_ps2_obj_t* self) {
// External pull-up
gpio_set_pin_direction(self->data_pin, GPIO_DIRECTION_IN);
gpio_set_pin_pull_mode(self->data_pin, GPIO_PULL_OFF);
}
static bool wait_data_lo(ps2io_ps2_obj_t* self, uint32_t us) {
data_hi(self);
common_hal_mcu_delay_us(1);
while (gpio_get_pin_level(self->data_pin) && us) {
--us;
common_hal_mcu_delay_us(1);
}
return us;
}
static bool wait_data_hi(ps2io_ps2_obj_t* self, uint32_t us) {
data_hi(self);
common_hal_mcu_delay_us(1);
while (!gpio_get_pin_level(self->data_pin) && us) {
--us;
common_hal_mcu_delay_us(1);
}
return us;
}
static void data_lo(ps2io_ps2_obj_t* self) {
gpio_set_pin_pull_mode(self->data_pin, GPIO_PULL_OFF);
gpio_set_pin_direction(self->data_pin, GPIO_DIRECTION_OUT);
gpio_set_pin_level(self->data_pin, 0);
}
static void idle(ps2io_ps2_obj_t* self) {
clk_hi(self);
data_hi(self);
}
static void inhibit(ps2io_ps2_obj_t* self) {
clk_lo(self);
data_hi(self);
}
static void delay_us(uint32_t t) {
common_hal_mcu_delay_us(t);
}
void ps2_interrupt_handler(uint8_t channel) {
// Grab the current time first.
uint32_t current_us;
uint64_t current_ms;
current_tick(&current_ms, &current_us);
ps2io_ps2_obj_t* self = get_eic_channel_data(channel);
int data_bit = gpio_get_pin_level(self->data_pin) ? 1 : 0;
// test for timeout
if (self->state != STATE_IDLE) {
int64_t diff_ms = current_ms - self->last_int_ms;
if (diff_ms >= 2) { // a.k.a. > 1.001ms
self->last_errors |= ERROR_TIMEOUT;
self->state = STATE_IDLE;
}
}
self->last_int_us = current_us;
self->last_int_ms = current_ms;
if (self->state == STATE_IDLE) {
self->bits = 0;
self->parity = false;
self->bitcount = 0;
self->state = STATE_RECV;
if (data_bit) {
// start bit should be 0
self->last_errors |= ERROR_STARTBIT;
self->state = STATE_RECV_ERR;
} else {
self->state = STATE_RECV;
}
} else if (self->state == STATE_RECV) {
if (data_bit) {
self->bits |= data_bit << self->bitcount;
self->parity = !self->parity;
}
++self->bitcount;
if (self->bitcount >= 8) {
self->state = STATE_RECV_PARITY;
}
} else if (self->state == STATE_RECV_PARITY) {
++self->bitcount;
if (data_bit) {
self->parity = !self->parity;
}
if (!self->parity) {
self->last_errors |= ERROR_PARITY;
self->state = STATE_RECV_ERR;
} else {
self->state = STATE_RECV_STOP;
}
} else if (self->state == STATE_RECV_STOP) {
++self->bitcount;
if (! data_bit) {
self->last_errors |= ERROR_STOPBIT;
} else if (self->waiting_cmd_response) {
self->cmd_response = self->bits;
self->waiting_cmd_response = false;
} else if (self->bufcount >= sizeof(self->buffer)) {
self->last_errors |= ERROR_BUFFER;
} else {
self->buffer[self->bufposw] = self->bits;
self->bufposw = (self->bufposw + 1) % sizeof(self->buffer);
self->bufcount++;
}
self->state = STATE_IDLE;
} else if (self->state == STATE_RECV_ERR) {
// just count the bits until idle
if (++self->bitcount >= 10) {
self->state = STATE_IDLE;
}
}
}
void common_hal_ps2io_ps2_construct(ps2io_ps2_obj_t* self,
const mcu_pin_obj_t* data_pin, const mcu_pin_obj_t* clk_pin) {
if (!clk_pin->has_extint) {
mp_raise_RuntimeError(translate("No hardware support on clk pin"));
}
if (eic_get_enable() && !eic_channel_free(clk_pin->extint_channel)) {
mp_raise_RuntimeError(translate("EXTINT channel already in use"));
}
clk_hi(self);
data_hi(self);
self->channel = clk_pin->extint_channel;
self->clk_pin = clk_pin->number;
self->data_pin = data_pin->number;
self->state = STATE_IDLE;
self->bufcount = 0;
self->bufposr = 0;
self->bufposw = 0;
self->waiting_cmd_response = false;
set_eic_channel_data(clk_pin->extint_channel, (void*) self);
// Check to see if the EIC is enabled and start it up if its not.'
if (eic_get_enable() == 0) {
turn_on_external_interrupt_controller();
}
gpio_set_pin_function(clk_pin->number, GPIO_PIN_FUNCTION_A);
gpio_set_pin_function(data_pin->number, GPIO_PIN_FUNCTION_A);
turn_on_cpu_interrupt(self->channel);
claim_pin(clk_pin);
claim_pin(data_pin);
// Set config will enable the EIC.
ps2_set_config(self);
}
bool common_hal_ps2io_ps2_deinited(ps2io_ps2_obj_t* self) {
return self->clk_pin == NO_PIN;
}
void common_hal_ps2io_ps2_deinit(ps2io_ps2_obj_t* self) {
if (common_hal_ps2io_ps2_deinited(self)) {
return;
}
set_eic_handler(self->channel, EIC_HANDLER_NO_INTERRUPT);
turn_off_eic_channel(self->channel);
reset_pin_number(self->clk_pin);
reset_pin_number(self->data_pin);
self->clk_pin = NO_PIN;
self->data_pin = NO_PIN;
}
uint16_t common_hal_ps2io_ps2_get_len(ps2io_ps2_obj_t* self) {
return self->bufcount;
}
bool common_hal_ps2io_ps2_get_paused(ps2io_ps2_obj_t* self) {
uint32_t mask = 1 << self->channel;
return (EIC->INTENSET.reg & (mask << EIC_INTENSET_EXTINT_Pos)) == 0;
}
int16_t common_hal_ps2io_ps2_popleft(ps2io_ps2_obj_t* self)
{
common_hal_mcu_disable_interrupts();
if (self->bufcount <= 0) {
common_hal_mcu_enable_interrupts();
return -1;
}
uint8_t b = self->buffer[self->bufposr];
self->bufposr = (self->bufposr + 1) % sizeof(self->buffer);
self->bufcount -= 1;
common_hal_mcu_enable_interrupts();
return b;
}
uint16_t common_hal_ps2io_ps2_clear_errors(ps2io_ps2_obj_t* self)
{
common_hal_mcu_disable_interrupts();
uint16_t errors = self->last_errors;
self->last_errors = 0;
common_hal_mcu_enable_interrupts();
return errors;
}
// Based upon TMK implementation of PS/2 protocol
// https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/protocol/ps2_interrupt.c
int16_t common_hal_ps2io_ps2_sendcmd(ps2io_ps2_obj_t* self, uint8_t b)
{
disable_interrupt(self);
inhibit(self);
delay_us(100);
/* RTS and start bit */
data_lo(self);
clk_hi(self);
if (!wait_clk_lo(self, 10000)) {
self->last_errors |= ERROR_TX_RTS;
goto ERROR;
}
bool parity = true;
for (uint8_t i = 0; i < 8; i++) {
delay_us(15);
if (b & (1 << i)) {
parity = !parity;
data_hi(self);
} else {
data_lo(self);
}
if (!wait_clk_hi(self, 50)) {
self->last_errors |= ERROR_TX_CLKHI;
goto ERROR;
}
if (!wait_clk_lo(self, 50)) {
self->last_errors |= ERROR_TX_CLKLO;
goto ERROR;
}
}
delay_us(15);
if (parity) {
data_hi(self);
} else {
data_lo(self);
}
if (!wait_clk_hi(self, 50)) {
self->last_errors |= ERROR_TX_CLKHI;
goto ERROR;
}
if (!wait_clk_lo(self, 50)) {
self->last_errors |= ERROR_TX_CLKLO;
goto ERROR;
}
/* Stop bit */
delay_us(15);
data_hi(self);
/* Ack */
if (!wait_data_lo(self, 50)) {
self->last_errors |= ERROR_TX_ACKDATA;
goto ERROR;
}
if (!wait_clk_lo(self, 50)) {
self->last_errors |= ERROR_TX_ACKCLK;
goto ERROR;
}
/* wait for idle state */
if (!wait_clk_hi(self, 50)) {
self->last_errors |= ERROR_TX_ACKCLK;
goto ERROR;
}
if (!wait_data_hi(self, 50)) {
self->last_errors |= ERROR_TX_ACKDATA;
goto ERROR;
}
/* Wait for response byte */
self->waiting_cmd_response = true;
idle(self);
resume_interrupt(self);
for (int i = 0; i < 25; ++i) {
delay_us(1000);
common_hal_mcu_disable_interrupts();
bool has_response = !self->waiting_cmd_response;
uint8_t response = self->cmd_response;
common_hal_mcu_enable_interrupts();
if (has_response) {
return response;
}
}
/* No response */
common_hal_mcu_disable_interrupts();
self->waiting_cmd_response = false;
self->last_errors |= ERROR_TX_NORESP;
common_hal_mcu_enable_interrupts();
return -1;
/* Other errors */
ERROR:
idle(self);
resume_interrupt(self);
return -1;
}

View File

@ -1,9 +1,10 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2018 Artur Pacholec
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
* Copyright (c) 2019 Elvis Pfutzenreuter <epxx@epxx.co>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@ -24,27 +25,38 @@
* THE SOFTWARE.
*/
#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_ADDRESSTYPE_H
#define MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_ADDRESSTYPE_H
#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PS2IO_PS2_H
#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PS2IO_PS2_H
#include "common-hal/microcontroller/Pin.h"
#include "py/obj.h"
typedef enum {
ADDRESS_PUBLIC,
ADDRESS_RANDOM_STATIC,
ADDRESS_RANDOM_PRIVATE_RESOLVABLE,
ADDRESS_RANDOM_PRIVATE_NON_RESOLVABLE
} bleio_address_type_t;
extern const mp_obj_type_t bleio_addresstype_type;
typedef struct {
mp_obj_base_t base;
} bleio_addresstype_obj_t;
uint8_t channel;
uint8_t clk_pin;
uint8_t data_pin;
extern const bleio_addresstype_obj_t bleio_addresstype_public_obj;
extern const bleio_addresstype_obj_t bleio_addresstype_random_static_obj;
extern const bleio_addresstype_obj_t bleio_addresstype_random_private_resolvable_obj;
extern const bleio_addresstype_obj_t bleio_addresstype_random_private_non_resolvable_obj;
uint8_t state;
uint64_t last_int_ms;
uint32_t last_int_us;
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_ADDRESSTYPE_H
uint16_t bits;
bool parity;
uint8_t bitcount;
uint8_t buffer[16];
uint8_t bufcount;
uint8_t bufposr;
uint8_t bufposw;
uint16_t last_errors;
bool waiting_cmd_response;
uint8_t cmd_response;
} ps2io_ps2_obj_t;
void ps2_interrupt_handler(uint8_t channel);
#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PS2IO_PS2_H

View File

@ -0,0 +1 @@
// No ps2io module functions.

View File

@ -25,6 +25,7 @@
*/
#include "common-hal/pulseio/PulseIn.h"
#include "common-hal/ps2io/Ps2.h"
#include "common-hal/rotaryio/IncrementalEncoder.h"
#include "shared-bindings/microcontroller/__init__.h"
//#include "samd/external_interrupts.h"
@ -46,6 +47,12 @@ void shared_eic_handler(uint8_t channel) {
break;
#endif
#if CIRCUITPY_PS2IO
case EIC_HANDLER_PS2:
ps2_interrupt_handler(channel);
break;
#endif
#if CIRCUITPY_ROTARYIO
case EIC_HANDLER_INCREMENTAL_ENCODER:
incrementalencoder_interrupt_handler(channel);

View File

@ -29,6 +29,7 @@
#define EIC_HANDLER_NO_INTERRUPT 0x0
#define EIC_HANDLER_PULSEIN 0x1
#define EIC_HANDLER_INCREMENTAL_ENCODER 0x2
#define EIC_HANDLER_PS2 0x3
void set_eic_handler(uint8_t channel, uint8_t eic_handler);
void shared_eic_handler(uint8_t channel);

View File

@ -52,6 +52,7 @@
#include "common-hal/pulseio/PulseIn.h"
#include "common-hal/pulseio/PulseOut.h"
#include "common-hal/pulseio/PWMOut.h"
#include "common-hal/ps2io/Ps2.h"
#include "common-hal/rtc/RTC.h"
#include "common-hal/touchio/TouchIn.h"
#include "samd/cache.h"

View File

@ -156,6 +156,9 @@ capabilities = {
"PA14", "PA15", "PA16", "PA17", "PA18", "PA19", "PA20",
"PA21", "PA22", "PA23", "PA30", "PA31"]
},
"ps2io": {
"Ps2": ALL_BUT_USB,
},
"touchio": {
"TouchIn": ["PA02", "PA03", "PB08", "PB09", "PA04", "PA05", "PA06",
"PA07", "PB02", "PB03"]

View File

@ -79,6 +79,7 @@ feather_nrf52840_express | s140 | Peripheral and Scanner | UF
makerdiary_nrf52840_mdk | s140 | Peripheral and Scanner | pyocd or ARM mbed DAPLink
makerdiary_nrf52840_mdk_usb_dongle | s140 | Peripheral and Scanner | DFU bootloader & nrfutil
electronut_labs_papyr | s140 | Peripheral and Scanner | UF2 bootloader
electronut_labs_blip | s140 | Peripheral and Scanner | Black Magic Probe
## Segger Targets

View File

@ -29,7 +29,7 @@
#include "supervisor/usb.h"
#include "supervisor/shared/stack.h"
#ifdef CIRCUITPY_DISPLAYIO
#if CIRCUITPY_DISPLAYIO
#include "shared-module/displayio/__init__.h"
#endif
@ -48,7 +48,7 @@ void run_background_tasks(void) {
filesystem_background();
usb_background();
#ifdef CIRCUITPY_DISPLAYIO
#if CIRCUITPY_DISPLAYIO
displayio_refresh_displays();
#endif
running_background_tasks = false;

View File

@ -0,0 +1,67 @@
# Setup
The `Electronut Labs Blip` board is a development board based on the `nRF52840` SoC from
Nordic Semiconductors. It has a Black Magic Probe compatible programmer and debugger
built in, along with temperature/humidity sensor, ambient light intensity sensor, and
a 3-axis accelerometer. It can be used to prototype very low power devices. It also has
provision for an SD card slot, which makes it a complete and versatile development board.
Schematic, datasheet, pin mapping etc. can be found over [here](https://docs.electronut.in/blip/).
Features:
* Raytac MDBT50Q-1M module based on Nordic Semiconductor's nRF52840
* LIS2DDH12 High-performance 3-axis "femto" accelerometer
* Optical Sensor LTR-329ALS-01
* Si7006-A20 I2C humidity and temperature sensor
* On board STM32F103CBT6 as Black magic probe debugger
* NFC Antenna
* MicroSD slot
* Power Supply: USB, JST connector for Li-ion/Li-po
* BQ24079 battery charging and power management IC
## Installing CircuitPython submodules
Before you can build, you will need to run the following commands once, which
will install the submodules that are part of the CircuitPython ecosystem, and
build the `mpy-cross` tool:
```
$ cd circuitpython
$ git submodule update --init
$ make -C mpy-cross
```
## Building and Flashing CircuitPython
No special notes for this, follow `ports/nrf` generic `README.md`.
### Flashing CircuitPython with GDB using on board Black magic probe debugger
```
$ cd ports/nrf
$ make V=1 SD=s140 SERIAL=/dev/ttyACM0 BOARD=electronut_labs_blip all
...
...
LINK build-electronut_labs_blip-s140/firmware.elf
778588 bytes free in flash out of 1048576 bytes ( 1024.0 kb ).
228320 bytes free in ram for stack out of 245760 bytes ( 240.0 kb ).
Create build-electronut_labs_blip-s140/firmware.bin
Create build-electronut_labs_blip-s140/firmware.hex
Create build-electronut_labs_blip-s140/firmware.uf2
python3 ../../tools/uf2/utils/uf2conv.py -f 0xADA52840 -c -o "build-electronut_labs_blip-s140/firmware.uf2" build-electronut_labs_blip-s140/firmware.hex
Converting to uf2, output size: 540160, start address: 0x26000
Wrote 540160 bytes to build-electronut_labs_blip-s140/firmware.uf2.
```
Now you can use either `.hex` or `.elf` from the generated files inside
`build-electronut_labs_blip-s140` directory. Now you can use `arm-none-eabi-gdb`
to flash circuitpython on Blip.
### Other tips
Once circuitpython is running on your board, it will come up as a mass storage
device named `CIRCUITPY`, where you can drop in your python code. The file names
it looks for are `main.py`, `main.txt`, `code.py` or `code.txt`.

View File

@ -0,0 +1,38 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2017 Scott Shawcroft 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.
*/
#include "boards/board.h"
void board_init(void) {
}
bool board_requests_safe_mode(void) {
return false;
}
void reset_board(void) {
}

View File

@ -0,0 +1,53 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2016 Glenn Ruben Bakke
* Copyright (c) 2018 Dan Halbert for Adafruit Industries
* Copyright (c) 2019 tavish@electronut.in
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "nrfx/hal/nrf_gpio.h"
#define ELECTRONUT_LABS_PAPYR
#define MICROPY_HW_BOARD_NAME "Electronut Labs Blip"
#define MICROPY_HW_MCU_NAME "nRF52840"
#define MICROPY_PY_SYS_PLATFORM "ElectronutLabsPapyr"
#define CIRCUITPY_AUTORELOAD_DELAY_MS 500
// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE)
#define BOARD_HAS_CRYSTAL 1
#define DEFAULT_I2C_BUS_SCL (&pin_P0_11)
#define DEFAULT_I2C_BUS_SDA (&pin_P0_12)
#define DEFAULT_SPI_BUS_SCK (&pin_P0_25)
#define DEFAULT_SPI_BUS_MOSI (&pin_P1_02)
#define DEFAULT_SPI_BUS_MISO (&pin_P0_24)
#define DEFAULT_UART_BUS_RX (&pin_P0_08)
#define DEFAULT_UART_BUS_TX (&pin_P0_06)

View File

@ -0,0 +1,22 @@
USB_VID = 0x239A
USB_PID = 0x803C
USB_PRODUCT = "Blip"
USB_MANUFACTURER = "Electronut Labs"
MCU_SERIES = m4
MCU_VARIANT = nrf52
MCU_SUB_VARIANT = nrf52840
MCU_CHIP = nrf52840
SD ?= s140
SOFTDEV_VERSION ?= 6.1.0
BOOT_SETTING_ADDR = 0xFF000
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

View File

@ -0,0 +1,72 @@
#include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_03) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_04) },
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_28) },
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_P0_29) },
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_P0_30) },
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_P0_31) },
{ MP_ROM_QSTR(MP_QSTR_NFC1), MP_ROM_PTR(&pin_P0_09) },
{ MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10) },
// odd row
{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P0_02) },
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P0_04) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P0_06) },
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P0_08) },
{ MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_P0_19) },
{ MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_P0_21) },
{ MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_P0_26) },
{ MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_P0_27) },
{ MP_ROM_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_P0_29) },
{ MP_ROM_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_P0_31) },
{ MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_P1_01) },
{ MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_P1_04) },
{ MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_P1_06) },
// even row
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P0_03) },
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P0_05) },
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P0_07) },
{ MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_P0_16) },
{ MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_P0_20) },
{ MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_P0_22) },
{ MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_P0_23) },
{ MP_ROM_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_P0_28) },
{ MP_ROM_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_P0_30) },
{ MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_P1_00) },
{ MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_P1_03) },
{ MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_P1_05) },
{ MP_ROM_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_P1_08) },
// SCL SDA as pins also
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_P0_11) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_P0_12) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_11) },
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_12) },
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_25) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_24) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P1_02) },
{ MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_P0_17) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_06) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_08) },
{ MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P0_14) },
{ MP_ROM_QSTR(MP_QSTR_RED_LED), MP_ROM_PTR(&pin_P0_14) },
{ MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_P0_15) },
{ MP_ROM_QSTR(MP_QSTR_GREEN_LED), MP_ROM_PTR(&pin_P0_13) },
{ MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_P1_07) },
{ MP_ROM_QSTR(MP_QSTR_RESET), MP_ROM_PTR(&pin_P0_18) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

View File

@ -136,17 +136,15 @@ void common_hal_bleio_adapter_get_address(bleio_address_obj_t *address) {
uint32_t err_code;
common_hal_bleio_adapter_set_enabled(true);
#if (BLE_API_VERSION == 2)
err_code = sd_ble_gap_address_get(&local_address);
#else
err_code = sd_ble_gap_addr_get(&local_address);
#endif
if (err_code != NRF_SUCCESS) {
mp_raise_OSError_msg(translate("Failed to get local address"));
}
address->type = local_address.addr_type;
memcpy(address->value, local_address.addr, BLEIO_ADDRESS_BYTES);
mp_buffer_info_t buf_info;
mp_get_buffer_raise(address, &buf_info, MP_BUFFER_READ);
memcpy(address->bytes, buf_info.buf, NUM_BLEIO_ADDRESS_BYTES);
}

View File

@ -32,6 +32,7 @@
#include "ble_drv.h"
#include "ble_hci.h"
#include "nrf_soc.h"
#include "py/gc.h"
#include "py/objstr.h"
#include "py/runtime.h"
#include "shared-bindings/bleio/Adapter.h"

View File

@ -51,15 +51,14 @@ STATIC void on_ble_evt(ble_evt_t *ble_evt, void *scanner_in) {
return;
}
// TODO: Don't add new entry for each item, group by address and update
bleio_scanentry_obj_t *entry = m_new_obj(bleio_scanentry_obj_t);
entry->base.type = &bleio_scanentry_type;
entry->rssi = report->rssi;
memcpy(entry->address.bytes, report->data.p_data, NUM_BLEIO_ADDRESS_BYTES);
entry->address.type = report->peer_addr.addr_type;
memcpy(entry->address.value, report->peer_addr.addr, BLEIO_ADDRESS_BYTES);
entry->data = mp_obj_new_bytearray(report->data.len, report->data.p_data);
entry->data = mp_obj_new_bytes(report->data.p_data, report->data.len);
mp_obj_list_append(scanner->adv_reports, entry);

View File

@ -93,16 +93,22 @@ void reset_port(void) {
i2c_reset();
spi_reset();
uart_reset();
#if CIRCUITPY_PULSEIO
pwmout_reset();
pulseout_reset();
pulsein_reset();
#endif
timers_reset();
#if CIRCUITPY_RTC
#if CIRCUITPY_RTC
rtc_reset();
#endif
#endif
#if CIRCUITPY_BLEIO
bleio_reset();
#endif
reset_all_pins();
}

View File

@ -162,6 +162,9 @@ endif
ifeq ($(CIRCUITPY_PULSEIO),1)
SRC_PATTERNS += pulseio/%
endif
ifeq ($(CIRCUITPY_PS2IO),1)
SRC_PATTERNS += ps2io/%
endif
ifeq ($(CIRCUITPY_RANDOM),1)
SRC_PATTERNS += random/%
endif
@ -251,6 +254,8 @@ $(filter $(SRC_PATTERNS), \
pulseio/PulseIn.c \
pulseio/PulseOut.c \
pulseio/__init__.c \
ps2io/Ps2.c \
ps2io/__init__.c \
rotaryio/IncrementalEncoder.c \
rotaryio/__init__.c \
rtc/RTC.c \
@ -283,7 +288,6 @@ SRC_BINDINGS_ENUMS += \
SRC_BINDINGS_ENUMS += \
$(filter $(SRC_PATTERNS), \
bleio/Address.c \
bleio/AddressType.c \
bleio/ScanEntry.c \
)
@ -359,3 +363,8 @@ $(addprefix lib/,\
libm/atan2f.c \
)
endif
.PHONY: check-release-needs-clean-build
check-release-needs-clean-build:
@echo "RELEASE_NEEDS_CLEAN_BUILD = $(RELEASE_NEEDS_CLEAN_BUILD)"

View File

@ -72,6 +72,7 @@
#define MICROPY_KBD_EXCEPTION (1)
#define MICROPY_MEM_STATS (0)
#define MICROPY_NONSTANDARD_TYPECODES (0)
#define MICROPY_OPT_COMPUTED_GOTO (1)
#define MICROPY_PERSISTENT_CODE_LOAD (1)
#define MICROPY_PY_ARRAY (1)
@ -89,6 +90,7 @@
#define MICROPY_PY_BUILTINS_MIN_MAX (1)
#define MICROPY_PY_BUILTINS_PROPERTY (1)
#define MICROPY_PY_BUILTINS_REVERSED (1)
#define MICROPY_PY_BUILTINS_ROUND_INT (1)
#define MICROPY_PY_BUILTINS_SET (1)
#define MICROPY_PY_BUILTINS_SLICE (1)
#define MICROPY_PY_BUILTINS_SLICE_ATTRS (1)
@ -415,6 +417,13 @@ extern const struct _mp_obj_module_t pulseio_module;
#define PULSEIO_MODULE
#endif
#if CIRCUITPY_PS2IO
extern const struct _mp_obj_module_t ps2io_module;
#define PS2IO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_ps2io), (mp_obj_t)&ps2io_module },
#else
#define PS2IO_MODULE
#endif
#if CIRCUITPY_RANDOM
extern const struct _mp_obj_module_t random_module;
#define RANDOM_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_random), (mp_obj_t)&random_module },
@ -579,6 +588,7 @@ extern const struct _mp_obj_module_t ustack_module;
PEW_MODULE \
PIXELBUF_MODULE \
PULSEIO_MODULE \
PS2IO_MODULE \
RANDOM_MODULE \
RE_MODULE \
ROTARYIO_MODULE \

View File

@ -32,13 +32,13 @@
# CIRCUITPY_FULL_BUILD = 0
ifndef CIRCUITPY_FULL_BUILD
ifeq ($(CIRCUITPY_SMALL_BUILD),1)
CIRCUITPY_FULL_BUILD = 0
CFLAGS += -DCIRCUITPY_FULL_BUILD=0
else
CIRCUITPY_FULL_BUILD = 1
CFLAGS += -DCIRCUITPY_FULL_BUILD=1
endif
ifeq ($(CIRCUITPY_SMALL_BUILD),1)
CIRCUITPY_FULL_BUILD = 0
CFLAGS += -DCIRCUITPY_FULL_BUILD=0
else
CIRCUITPY_FULL_BUILD = 1
CFLAGS += -DCIRCUITPY_FULL_BUILD=1
endif
endif
# All builtin modules are listed below, with default values (0 for off, 1 for on)
@ -153,6 +153,12 @@ CIRCUITPY_PULSEIO = 1
endif
CFLAGS += -DCIRCUITPY_PULSEIO=$(CIRCUITPY_PULSEIO)
# Only for SAMD boards for the moment
ifndef CIRCUITPY_PS2IO
CIRCUITPY_PS2IO = 0
endif
CFLAGS += -DCIRCUITPY_PS2IO=$(CIRCUITPY_PS2IO)
ifndef CIRCUITPY_RANDOM
CIRCUITPY_RANDOM = 1
endif

View File

@ -383,6 +383,10 @@ void gc_collect_start(void) {
#endif
}
void gc_collect_ptr(void *ptr) {
gc_mark(ptr);
}
void gc_collect_root(void **ptrs, size_t len) {
for (size_t i = 0; i < len; i++) {
void *ptr = ptrs[i];

View File

@ -43,6 +43,7 @@ bool gc_is_locked(void);
// A given port must implement gc_collect by using the other collect functions.
void gc_collect(void);
void gc_collect_start(void);
void gc_collect_ptr(void *ptr);
void gc_collect_root(void **ptrs, size_t len);
void gc_collect_end(void);

View File

@ -455,13 +455,13 @@ STATIC mp_obj_t mp_builtin_round(size_t n_args, const mp_obj_t *args) {
return o_in;
}
#if !MICROPY_PY_BUILTINS_ROUND_INT
mp_raise_NotImplementedError(NULL);
#else
mp_int_t num_dig = mp_obj_get_int(args[1]);
if (num_dig >= 0) {
return o_in;
}
#if !MICROPY_PY_BUILTINS_ROUND_INT
mp_raise_NotImplementedError(NULL);
#else
mp_obj_t mult = mp_binary_op(MP_BINARY_OP_POWER, MP_OBJ_NEW_SMALL_INT(10), MP_OBJ_NEW_SMALL_INT(-num_dig));
mp_obj_t half_mult = mp_binary_op(MP_BINARY_OP_FLOOR_DIVIDE, mult, MP_OBJ_NEW_SMALL_INT(2));

View File

@ -107,9 +107,9 @@ endif
# External modules written in C.
ifneq ($(USER_C_MODULES),)
# pre-define USERMOD variables as expanded so that variables are immediate
# pre-define USERMOD variables as expanded so that variables are immediate
# expanded as they're added to them
SRC_USERMOD :=
SRC_USERMOD :=
CFLAGS_USERMOD :=
LDFLAGS_USERMOD :=
$(foreach module, $(wildcard $(USER_C_MODULES)/*/micropython.mk), \
@ -343,10 +343,23 @@ $(PY_BUILD)/qstr.o: $(HEADER_BUILD)/qstrdefs.generated.h
$(PY_BUILD)/nlr%.o: CFLAGS += -Os
# optimising gc for speed; 5ms down to 4ms on pybv2
ifndef SUPEROPT_GC
SUPEROPT_GC = 1
endif
ifeq ($(SUPEROPT_GC),1)
$(PY_BUILD)/gc.o: CFLAGS += $(CSUPEROPT)
endif
# optimising vm for speed, adds only a small amount to code size but makes a huge difference to speed (20% faster)
ifndef SUPEROPT_VM
SUPEROPT_VM = 1
endif
ifeq ($(SUPEROPT_VM),1)
$(PY_BUILD)/vm.o: CFLAGS += $(CSUPEROPT)
endif
# Optimizing vm.o for modern deeply pipelined CPUs with branch predictors
# may require disabling tail jump optimization. This will make sure that
# each opcode has its own dispatching jump which will improve branch

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#if __clang__
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winitializer-overrides"
#endif // __clang__
@ -113,6 +113,6 @@ static const void *const entry_table[256] = {
[MP_BC_BINARY_OP_MULTI ... MP_BC_BINARY_OP_MULTI + MP_BINARY_OP_NUM_BYTECODE - 1] = &&entry_MP_BC_BINARY_OP_MULTI,
};
#if __clang__
#ifdef __clang__
#pragma clang diagnostic pop
#endif // __clang__

1
requirements-dev.txt Normal file
View File

@ -0,0 +1 @@
rst2pyi>=0.3.0

22
setup.py Normal file
View File

@ -0,0 +1,22 @@
from datetime import datetime
from setuptools import setup
from pathlib import Path
stub_root = Path("circuitpython-stubs")
stubs = [p.relative_to(stub_root).as_posix() for p in stub_root.glob("*.pyi")]
now = datetime.utcnow()
version = now.strftime("%Y.%m.%d")
setup(
name="circuitpython-stubs",
description="PEP 561 type stubs for CircuitPython",
url="https://github.com/adafruit/circuitpython",
maintainer="CircuitPythonistas",
author_email="circuitpython@adafruit.com",
version=version,
license="MIT",
package_data={"circuitpython-stubs": stubs},
packages=["circuitpython-stubs"],
setup_requires=["setuptools>=38.6.0"],
)

View File

@ -96,8 +96,9 @@ STATIC mp_obj_t pewpew_make_new(const mp_obj_type_t *type, size_t n_args,
mp_raise_TypeError(translate("Row entry must be digitalio.DigitalInOut"));
}
digitalio_digitalinout_obj_t *pin = MP_OBJ_TO_PTR(rows[i]);
raise_error_if_deinited(
common_hal_digitalio_digitalinout_deinited(pin));
if (common_hal_digitalio_digitalinout_deinited(pin)) {
raise_deinited_error();
}
}
for (size_t i = 0; i < cols_size; ++i) {
@ -105,8 +106,9 @@ STATIC mp_obj_t pewpew_make_new(const mp_obj_type_t *type, size_t n_args,
mp_raise_TypeError(translate("Column entry must be digitalio.DigitalInOut"));
}
digitalio_digitalinout_obj_t *pin = MP_OBJ_TO_PTR(cols[i]);
raise_error_if_deinited(
common_hal_digitalio_digitalinout_deinited(pin));
if (common_hal_digitalio_digitalinout_deinited(pin)) {
raise_deinited_error();
}
}
if (!MP_OBJ_IS_TYPE(args[ARG_buttons].u_obj,
@ -115,8 +117,9 @@ STATIC mp_obj_t pewpew_make_new(const mp_obj_type_t *type, size_t n_args,
}
digitalio_digitalinout_obj_t *buttons = MP_OBJ_TO_PTR(
args[ARG_buttons].u_obj);
raise_error_if_deinited(
common_hal_digitalio_digitalinout_deinited(buttons));
if (common_hal_digitalio_digitalinout_deinited(buttons)) {
raise_deinited_error();
}
pew_obj_t *pew = MP_STATE_VM(pew_singleton);
if (!pew) {

View File

@ -51,7 +51,7 @@ extern const int32_t colorwheel(float pos);
//|
//| :class:`~_pixelbuf.PixelBuf` implements an RGB[W] bytearray abstraction.
//|
//| .. class:: PixelBuf(size, buf, byteorder=BGR, bpp=3)
//| .. class:: PixelBuf(size, buf, byteorder=BGR, brightness=0, rawbuf=None, offset=0, dotstar=False, auto_write=False, write_function=None, write_args=None)
//|
//| Create a PixelBuf object of the specified size, byteorder, and bits per pixel.
//|
@ -66,14 +66,14 @@ extern const int32_t colorwheel(float pos);
//|
//| :param ~int size: Number of pixelsx
//| :param ~bytearray buf: Bytearray to store pixel data in
//| :param ~_pixelbuf.ByteOrder byteorder: Byte order constant from `_pixelbuf` (also sets the bpp)
//| :param ~_pixelbuf.ByteOrder byteorder: Byte order constant from `_pixelbuf`
//| :param ~float brightness: Brightness (0 to 1.0, default 1.0)
//| :param ~bytearray rawbuf: Bytearray to store raw pixel colors in
//| :param ~int offset: Offset from start of buffer (default 0)
//| :param ~bool dotstar: Dotstar mode (default False)
//| :param ~bool auto_write: Whether to automatically write pixels (Default False)
//| :param ~callable write_function: (optional) Callable to use to send pixels
//| :param ~list write_args: (optional) Tuple or list of args to pass to ``write_function``. The
//| :param ~list write_args: (optional) Tuple or list of args to pass to ``write_function``. The
//| PixelBuf instance is appended after these args.
//|
STATIC mp_obj_t pixelbuf_pixelbuf_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
@ -95,7 +95,7 @@ STATIC mp_obj_t pixelbuf_pixelbuf_make_new(const mp_obj_type_t *type, size_t n_a
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
if (mp_obj_is_subclass_fast(args[ARG_byteorder].u_obj, &pixelbuf_byteorder_type))
if (mp_obj_is_subclass_fast(args[ARG_byteorder].u_obj, &pixelbuf_byteorder_type))
mp_raise_TypeError_varg(translate("byteorder is not an instance of ByteOrder (got a %s)"), mp_obj_get_type_str(args[ARG_byteorder].u_obj));
pixelbuf_byteorder_obj_t *byteorder = (args[ARG_byteorder].u_obj == mp_const_none) ? MP_OBJ_FROM_PTR(&byteorder_BGR) : args[ARG_byteorder].u_obj;
@ -122,7 +122,7 @@ STATIC mp_obj_t pixelbuf_pixelbuf_make_new(const mp_obj_type_t *type, size_t n_a
if (!MP_OBJ_IS_TYPE(args[ARG_write_args].u_obj, &mp_type_list) &&
!MP_OBJ_IS_TYPE(args[ARG_write_args].u_obj, &mp_type_tuple) &&
args[ARG_write_args].u_obj != mp_const_none)
args[ARG_write_args].u_obj != mp_const_none)
{
mp_raise_ValueError(translate("write_args must be a list, tuple, or None"));
}
@ -186,8 +186,8 @@ STATIC mp_obj_t pixelbuf_pixelbuf_make_new(const mp_obj_type_t *type, size_t n_a
else if (self->brightness > 1)
self->brightness = 1;
}
if (self->dotstar_mode) {
if (self->dotstar_mode) {
// Initialize the buffer with the dotstar start bytes.
// Header and end must be setup by caller
for (uint i = 0; i < self->pixels * 4; i += 4) {
@ -197,7 +197,7 @@ STATIC mp_obj_t pixelbuf_pixelbuf_make_new(const mp_obj_type_t *type, size_t n_a
}
}
}
return MP_OBJ_FROM_PTR(self);
}
@ -227,7 +227,7 @@ const mp_obj_property_t pixelbuf_pixelbuf_bpp_obj = {
//| setting this value causes a recomputation of the values in buf.
//| If only a buf was provided, then the brightness only applies to
//| future pixel changes.
//| In DotStar mode
//| In DotStar mode
//|
STATIC mp_obj_t pixelbuf_pixelbuf_obj_get_brightness(mp_obj_t self_in) {
mp_check_self(MP_OBJ_IS_TYPE(self_in, &pixelbuf_pixelbuf_type));
@ -266,7 +266,7 @@ void pixelbuf_recalculate_brightness(pixelbuf_pixelbuf_obj_t *self) {
// Compensate for shifted buffer (bpp=3 dotstar)
for (uint i = 0; i < self->bytes; i++) {
// Don't adjust per-pixel luminance bytes in dotstar mode
if (!self->dotstar_mode || (i % 4 != 0))
if (!self->dotstar_mode || (i % 4 != 0))
buf[i] = rawbuf[i] * self->brightness;
}
}
@ -367,11 +367,13 @@ void call_write_function(pixelbuf_pixelbuf_obj_t *self) {
}
}
//| .. method:: []
//| .. method:: __getitem__(index)
//|
//| Get or set pixels. Supports individual pixels and slices.
//| Returns the pixel value at the given index.
//|
//| .. method:: __setitem__(index, value)
//|
//| Sets the pixel value at the given index.
//|
STATIC mp_obj_t pixelbuf_pixelbuf_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value) {
mp_check_self(MP_OBJ_IS_TYPE(self_in, &pixelbuf_pixelbuf_type));
@ -380,7 +382,7 @@ STATIC mp_obj_t pixelbuf_pixelbuf_subscr(mp_obj_t self_in, mp_obj_t index_in, mp
// delete item
// slice deletion
return MP_OBJ_NULL; // op not supported
}
}
pixelbuf_pixelbuf_obj_t *self = MP_OBJ_TO_PTR(self_in);
if (0) {
@ -390,7 +392,7 @@ STATIC mp_obj_t pixelbuf_pixelbuf_subscr(mp_obj_t self_in, mp_obj_t index_in, mp
if (!mp_seq_get_fast_slice_indexes(self->bytes, index_in, &slice))
mp_raise_NotImplementedError(translate("Only slices with step=1 (aka None) are supported"));
if ((slice.stop * self->pixel_step) > self->bytes)
if ((slice.stop * self->pixel_step) > self->bytes)
mp_raise_IndexError(translate("Range out of bounds"));
if (value == MP_OBJ_SENTINEL) { // Get
@ -422,8 +424,8 @@ STATIC mp_obj_t pixelbuf_pixelbuf_subscr(mp_obj_t self_in, mp_obj_t index_in, mp
for (size_t i = slice.start; i < slice.stop; i++) {
mp_obj_t *item = src_objs[i-slice.start];
if (MP_OBJ_IS_TYPE(value, &mp_type_list) || MP_OBJ_IS_TYPE(value, &mp_type_tuple) || MP_OBJ_IS_INT(value)) {
pixelbuf_set_pixel(self->buf + (i * self->pixel_step),
self->two_buffers ? self->rawbuf + (i * self->pixel_step) : NULL,
pixelbuf_set_pixel(self->buf + (i * self->pixel_step),
self->two_buffers ? self->rawbuf + (i * self->pixel_step) : NULL,
self->brightness, item, &self->byteorder, self->dotstar_mode);
}
}
@ -438,14 +440,14 @@ STATIC mp_obj_t pixelbuf_pixelbuf_subscr(mp_obj_t self_in, mp_obj_t index_in, mp
} else { // Single index rather than slice.
size_t index = mp_get_index(self->base.type, self->pixels, index_in, false);
size_t offset = (index * self->pixel_step);
if (offset > self->bytes)
if (offset > self->bytes)
mp_raise_IndexError(translate("Pixel beyond bounds of buffer"));
if (value == MP_OBJ_SENTINEL) { // Get
uint8_t *pixelstart = (uint8_t *)(self->two_buffers ? self->rawbuf : self->buf) + offset;
return pixelbuf_get_pixel(pixelstart, &self->byteorder, self->dotstar_mode);
} else { // Store
pixelbuf_set_pixel(self->buf + offset, self->two_buffers ? self->rawbuf + offset : NULL,
pixelbuf_set_pixel(self->buf + offset, self->two_buffers ? self->rawbuf + offset : NULL,
self->brightness, value, &self->byteorder, self->dotstar_mode);
if (self->auto_write)
call_write_function(self);

View File

@ -53,7 +53,7 @@
//|
//| PixelBuf
//| .. class:: ByteOrder
//| .. class:: ByteOrder()
//|
//| Classes representing byteorders for circuitpython
@ -169,34 +169,34 @@ const int32_t colorwheel(float pos) {
/// RGB
//| .. class:: RGB
//| .. data:: RGB
//|
//| * **order** Red, Green, Blue
//| * **bpp** 3
PIXELBUF_BYTEORDER(RGB, 3, 0, 1, 2, 3, false, false)
//| .. class:: RBG
//| .. data:: RBG
//|
//| * **order** Red, Blue, Green
//| * **bpp** 3
PIXELBUF_BYTEORDER(RBG, 3, 0, 2, 1, 3, false, false)
//| .. class:: GRB
//| .. data:: GRB
//|
//| * **order** Green, Red, Blue
//| * **bpp** 3
//|
//| Commonly used by NeoPixel.
PIXELBUF_BYTEORDER(GRB, 3, 1, 0, 2, 3, false, false)
//| .. class:: GBR
//| .. data:: GBR
//|
//| * **order** Green, Blue, Red
//| * **bpp** 3
PIXELBUF_BYTEORDER(GBR, 3, 1, 2, 0, 3, false, false)
//| .. class:: BRG
//| .. data:: BRG
//|
//| * **order** Blue, Red, Green
//| * **bpp** 3
PIXELBUF_BYTEORDER(BRG, 3, 2, 0, 1, 3, false, false)
//| .. class:: BGR
//| .. data:: BGR
//|
//| * **order** Blue, Green, Red
//| * **bpp** 3
@ -205,19 +205,19 @@ PIXELBUF_BYTEORDER(BRG, 3, 2, 0, 1, 3, false, false)
PIXELBUF_BYTEORDER(BGR, 3, 2, 1, 0, 3, false, false)
// RGBW
//| .. class:: RGBW
//| .. data:: RGBW
//|
//| * **order** Red, Green, Blue, White
//| * **bpp** 4
//| * **has_white** True
PIXELBUF_BYTEORDER(RGBW, 4, 0, 1, 2, 3, true, false)
//| .. class:: RBGW
//| .. data:: RBGW
//|
//| * **order** Red, Blue, Green, White
//| * **bpp** 4
//| * **has_white** True
PIXELBUF_BYTEORDER(RBGW, 4, 0, 2, 1, 3, true, false)
//| .. class:: GRBW
//| .. data:: GRBW
//|
//| * **order** Green, Red, Blue, White
//| * **bpp** 4
@ -225,19 +225,19 @@ PIXELBUF_BYTEORDER(RBGW, 4, 0, 2, 1, 3, true, false)
//|
//| Commonly used by RGBW NeoPixels.
PIXELBUF_BYTEORDER(GRBW, 4, 1, 0, 2, 3, true, false)
//| .. class:: GBRW
//| .. data:: GBRW
//|
//| * **order** Green, Blue, Red, White
//| * **bpp** 4
//| * **has_white** True
PIXELBUF_BYTEORDER(GBRW, 4, 1, 2, 0, 3, true, false)
//| .. class:: BRGW
//| .. data:: BRGW
//|
//| * **order** Blue, Red, Green, White
//| * **bpp** 4
//| * **has_white** True
PIXELBUF_BYTEORDER(BRGW, 4, 2, 0, 1, 3, true, false)
//| .. class:: BGRW
//| .. data:: BGRW
//|
//| * **order** Blue, Green, Red, White
//| * **bpp** 4
@ -248,37 +248,37 @@ PIXELBUF_BYTEORDER(BGRW, 4, 2, 1, 0, 3, true, false)
// Luminosity chosen because the luminosity of a Dotstar at full bright
// burns the eyes like looking at the Sun.
// https://www.thesaurus.com/browse/luminosity?s=t
//| .. class:: LRGB
//| .. data:: LRGB
//|
//| * **order** *Luminosity*, Red, Green, Blue
//| * **bpp** 4
//| * **has_luminosity** True
PIXELBUF_BYTEORDER(LRGB, 4, 1, 2, 3, 0, false, true)
//| .. class:: LRBG
//| .. data:: LRBG
//|
//| * **order** *Luminosity*, Red, Blue, Green
//| * **bpp** 4
//| * **has_luminosity** True
PIXELBUF_BYTEORDER(LRBG, 4, 1, 3, 2, 0, false, true)
//| .. class:: LGRB
//| .. data:: LGRB
//|
//| * **order** *Luminosity*, Green, Red, Blue
//| * **bpp** 4
//| * **has_luminosity** True
PIXELBUF_BYTEORDER(LGRB, 4, 2, 1, 3, 0, false, true)
//| .. class:: LGBR
//| .. data:: LGBR
//|
//| * **order** *Luminosity*, Green, Blue, Red
//| * **bpp** 4
//| * **has_luminosity** True
PIXELBUF_BYTEORDER(LGBR, 4, 2, 3, 1, 0, false, true)
//| .. class:: LBRG
//| .. data:: LBRG
//|
//| * **order** *Luminosity*, Blue, Red, Green
//| * **bpp** 4
//| * **has_luminosity** True
PIXELBUF_BYTEORDER(LBRG, 4, 3, 1, 2, 0, false, true)
//| .. class:: LBGR
//| .. data:: LBGR
//|
//| * **order** *Luminosity*, Blue, Green, Red
//| * **bpp** 4

View File

@ -86,6 +86,11 @@ STATIC mp_obj_t analogio_analogin_deinit(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(analogio_analogin_deinit_obj, analogio_analogin_deinit);
STATIC void check_for_deinit(analogio_analogin_obj_t *self) {
if (common_hal_analogio_analogin_deinited(self)) {
raise_deinited_error();
}
}
//| .. method:: __enter__()
//|
//| No-op used by Context Managers.
@ -113,7 +118,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogin___exit___obj, 4, 4,
//|
STATIC mp_obj_t analogio_analogin_obj_get_value(mp_obj_t self_in) {
analogio_analogin_obj_t *self = MP_OBJ_TO_PTR(self_in);
raise_error_if_deinited(common_hal_analogio_analogin_deinited(self));
check_for_deinit(self);
return MP_OBJ_NEW_SMALL_INT(common_hal_analogio_analogin_get_value(self));
}
MP_DEFINE_CONST_FUN_OBJ_1(analogio_analogin_get_value_obj, analogio_analogin_obj_get_value);
@ -132,7 +137,7 @@ const mp_obj_property_t analogio_analogin_value_obj = {
//|
STATIC mp_obj_t analogio_analogin_obj_get_reference_voltage(mp_obj_t self_in) {
analogio_analogin_obj_t *self = MP_OBJ_TO_PTR(self_in);
raise_error_if_deinited(common_hal_analogio_analogin_deinited(self));
check_for_deinit(self);
return mp_obj_new_float(common_hal_analogio_analogin_get_reference_voltage(self));
}
MP_DEFINE_CONST_FUN_OBJ_1(analogio_analogin_get_reference_voltage_obj,

View File

@ -112,7 +112,9 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogout___exit___obj, 4, 4
//| resolution, the value is 16-bit.
STATIC mp_obj_t analogio_analogout_obj_set_value(mp_obj_t self_in, mp_obj_t value) {
analogio_analogout_obj_t *self = MP_OBJ_TO_PTR(self_in);
raise_error_if_deinited(common_hal_analogio_analogout_deinited(self));
if (common_hal_analogio_analogout_deinited(self)) {
raise_deinited_error();
}
uint32_t v = mp_obj_get_int(value);
if (v >= (1 << 16)) {
mp_raise_ValueError(translate("AnalogOut is only 16 bits. Value must be less than 65536."));

Some files were not shown because too many files have changed in this diff Show More