Merge branch 'main' into color-converter-transparency

This commit is contained in:
Jensen Kuras 2020-10-19 18:13:44 -05:00 committed by GitHub
commit 38c8248b9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 368 additions and 189 deletions

View File

@ -2111,6 +2111,10 @@ msgstr ""
msgid "buffer too small"
msgstr ""
#: shared-bindings/socketpool/Socket.c
msgid "buffer too small for requested bytes"
msgstr ""
#: shared-bindings/_pew/PewPew.c
msgid "buttons must be digitalio.DigitalInOut"
msgstr ""

View File

@ -149,7 +149,7 @@ msgstr ""
#: py/obj.c
msgid "'%q' object is not subscriptable"
msgstr ""
msgstr "'%q' Objekt hat keine '__getitem__'-Methode (not subscriptable)"
#: py/emitinlinethumb.c py/emitinlinextensa.c
#, c-format
@ -1986,14 +1986,16 @@ msgstr "WatchDogTimer läuft aktuell nicht"
#: shared-bindings/watchdog/WatchDogTimer.c
msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET"
msgstr ""
"WatchDogTimer.mode kann nicht geändert werden, nachdem "
"er auf WatchDogMode.RESET gesetzt wurde"
#: shared-bindings/watchdog/WatchDogTimer.c
msgid "WatchDogTimer.timeout must be greater than 0"
msgstr ""
msgstr "WatchDogTimer.timeout muss größer als 0 sein"
#: supervisor/shared/safe_mode.c
msgid "Watchdog timer expired."
msgstr ""
msgstr "Watchdog timer abgelaufen "
#: py/builtinhelp.c
#, c-format
@ -2013,11 +2015,11 @@ msgstr ""
#: shared-bindings/wifi/Radio.c
msgid "WiFi password must be between 8 and 63 characters"
msgstr ""
msgstr "WiFi Passwort muss zwischen 8 und 63 Zeichen lang sein"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Writes not supported on Characteristic"
msgstr "Schreiben nicht unterstüzt für die Characteristic"
msgstr "Schreiben nicht unterstüzt für diese Charakteristik"
#: supervisor/shared/safe_mode.c
msgid "You are in safe mode: something unanticipated happened.\n"
@ -2035,7 +2037,7 @@ msgstr "__init__() sollte None zurückgeben"
#: py/objtype.c
msgid "__init__() should return None, not '%q'"
msgstr ""
msgstr "__init__() sollte None zurückgeben, nicht '%q'"
#: py/objobject.c
msgid "__new__ arg must be a user-type"
@ -2080,12 +2082,12 @@ msgstr "Argument hat falschen Typ"
#: extmod/ulab/code/linalg/linalg.c
msgid "argument must be ndarray"
msgstr ""
msgstr "Argument muss ein ndarray sein"
#: py/argcheck.c shared-bindings/_stage/__init__.c
#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c
msgid "argument num/types mismatch"
msgstr "Anzahl/Type der Argumente passen nicht"
msgstr "Anzahl/Typen der Argumente passen nicht"
#: py/runtime.c
msgid "argument should be a '%q' not a '%q'"
@ -2187,7 +2189,7 @@ msgstr "bytes mit mehr als 8 bits werden nicht unterstützt"
#: py/objarray.c
msgid "bytes length not a multiple of item size"
msgstr ""
msgstr "Byte-Länge ist kein vielfaches der Item-Größe"
#: py/objstr.c
msgid "bytes value out of range"
@ -2230,7 +2232,7 @@ msgstr "kann keinem Ausdruck zuweisen"
#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c
#: shared-module/_pixelbuf/PixelBuf.c
msgid "can't convert %q to %q"
msgstr ""
msgstr "kann %q nicht zu %q konvertieren"
#: py/objstr.c
msgid "can't convert '%q' object to %q implicitly"
@ -2238,7 +2240,7 @@ msgstr "Kann '%q' Objekt nicht implizit nach %q konvertieren"
#: py/obj.c
msgid "can't convert to %q"
msgstr ""
msgstr "kann nicht zu %q konvertieren"
#: py/objstr.c
msgid "can't convert to str implicitly"
@ -2292,7 +2294,7 @@ msgstr ""
#: shared-module/sdcardio/SDCard.c
msgid "can't set 512 block size"
msgstr ""
msgstr "Kann Blockgröße von 512 nicht setzen"
#: py/objnamedtuple.c
msgid "can't set attribute"
@ -2728,11 +2730,11 @@ msgstr "Indizes müssen Integer, Slices oder Boolesche Listen sein"
#: extmod/ulab/code/approx/approx.c
msgid "initial values must be iterable"
msgstr ""
msgstr "Ausgangswerte müssen iterierbar sein"
#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c
msgid "initial_value length is wrong"
msgstr ""
msgstr "Länge von initial_value ist falsch"
#: py/compile.c
msgid "inline assembler must be a function"
@ -3126,7 +3128,7 @@ msgstr "Objekt nicht iterierbar"
#: py/obj.c
msgid "object of type '%q' has no len()"
msgstr ""
msgstr "Object vom Typ '%q' hat kein len()"
#: py/obj.c
msgid "object with buffer protocol required"
@ -3180,11 +3182,11 @@ msgstr ""
#: shared-bindings/displayio/Bitmap.c
msgid "out of range of source"
msgstr ""
msgstr "Außerhalb des Bereichs der Quelle"
#: shared-bindings/displayio/Bitmap.c
msgid "out of range of target"
msgstr ""
msgstr "Außerhalb des Bereichs des Ziels"
#: py/objint_mpz.c
msgid "overflow converting long int to machine word"
@ -3396,7 +3398,7 @@ msgstr ""
#: shared-bindings/displayio/Bitmap.c
msgid "source palette too large"
msgstr ""
msgstr "Quell-Palette zu groß"
#: py/objstr.c
msgid "start/end indices"
@ -3424,7 +3426,7 @@ msgstr "stream operation ist nicht unterstützt"
#: py/objstrunicode.c
msgid "string indices must be integers, not %q"
msgstr ""
msgstr "String Indizes müssen Integer sein, nicht %q"
#: py/stream.c
msgid "string not supported; use bytes or bytearray"
@ -3465,7 +3467,7 @@ msgstr "time.struct_time() nimmt eine 9-Sequenz an"
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
msgid "timeout duration exceeded the maximum supported value"
msgstr ""
msgstr "Das Zeitlimit hat den maximal zulässigen Wert überschritten"
#: shared-bindings/busio/UART.c
msgid "timeout must be 0.0-100.0 seconds"
@ -3477,11 +3479,11 @@ msgstr "timeout muss >= 0.0 sein"
#: shared-module/sdcardio/SDCard.c
msgid "timeout waiting for v1 card"
msgstr ""
msgstr "Zeitlimit beim warten auf v1 Karte"
#: shared-module/sdcardio/SDCard.c
msgid "timeout waiting for v2 card"
msgstr ""
msgstr "Zeitlimit beim warten auf v2 Karte"
#: shared-bindings/time/__init__.c
msgid "timestamp out of range for platform time_t"
@ -3532,7 +3534,7 @@ msgstr "Typ vom Objekt '%q' hat kein Attribut '%q'"
#: py/objgenerator.c
msgid "type object 'generator' has no attribute '__await__'"
msgstr ""
msgstr "Das Typ-Objekt 'generator' hat kein Attribut '__await__'"
#: py/objtype.c
msgid "type takes 1 or 3 arguments"
@ -3577,7 +3579,7 @@ msgstr "unbekannter Konvertierungs specifier %c"
#: py/objstr.c
msgid "unknown format code '%c' for object of type '%q'"
msgstr ""
msgstr "Unbekannter Formatcode '%c' für Objekt vom Typ '%q'"
#: py/compile.c
msgid "unknown type"
@ -3638,7 +3640,7 @@ msgstr "value_count muss größer als 0 sein"
#: extmod/ulab/code/linalg/linalg.c
msgid "vectors must have same lengths"
msgstr ""
msgstr "Vektoren müssen die selbe Länge haben"
#: shared-bindings/watchdog/WatchDogTimer.c
msgid "watchdog timeout must be greater than 0"

View File

@ -8,15 +8,15 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-10-15 16:06+0530\n"
"PO-Revision-Date: 2020-10-09 17:19+0000\n"
"Last-Translator: dherrada <dylan.herrada@adafruit.com>\n"
"PO-Revision-Date: 2020-10-17 02:31+0000\n"
"Last-Translator: Alvaro Figueroa <alvaro@greencore.co.cr>\n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.3-dev\n"
"X-Generator: Weblate 4.3.1-dev\n"
#: main.c
msgid ""
@ -255,7 +255,7 @@ msgstr "'return' fuera de una función"
#: py/compile.c
msgid "'yield from' inside async function"
msgstr ""
msgstr "'yield from' dentro función asincrónica"
#: py/compile.c
msgid "'yield' outside function"
@ -284,7 +284,7 @@ msgstr "El canal EXTINT ya está siendo utilizado"
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
msgid "ADC2 is being used by WiFi"
msgstr ""
msgstr "ADC2 está siendo usado por WiFi"
#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c
#, c-format
@ -969,7 +969,7 @@ msgstr "Hardware en uso, pruebe pines alternativos"
#: shared-bindings/wifi/Radio.c
msgid "Hostname must be between 1 and 253 characters"
msgstr ""
msgstr "Hostname debe ser entre 1 y 253 caracteres"
#: extmod/vfs_posix_file.c py/objstringio.c
msgid "I/O operation on closed file"
@ -2803,7 +2803,7 @@ msgstr "especificador de formato inválido"
#: shared-bindings/wifi/Radio.c
msgid "invalid hostname"
msgstr ""
msgstr "hostname inválido"
#: extmod/modussl_axtls.c
msgid "invalid key"
@ -3522,7 +3522,7 @@ msgstr "objeto de tipo '%q' no tiene atributo '%q'"
#: py/objgenerator.c
msgid "type object 'generator' has no attribute '__await__'"
msgstr ""
msgstr "objeto tipo 'generator' no tiene un atributo '__await__'"
#: py/objtype.c
msgid "type takes 1 or 3 arguments"

View File

@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-10-15 16:06+0530\n"
"PO-Revision-Date: 2020-10-15 18:17+0000\n"
"Last-Translator: Jeff Epler <jepler@gmail.com>\n"
"PO-Revision-Date: 2020-10-17 15:35+0000\n"
"Last-Translator: Antonin ENFRUN <antonin.e@me.com>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.3-dev\n"
"X-Generator: Weblate 4.3.1-dev\n"
#: main.c
msgid ""
@ -23,7 +23,7 @@ msgid ""
"Code done running. Waiting for reload.\n"
msgstr ""
"\n"
"Fin d'éxecution du code. En attente de recharge.\n"
"Fin d'ecution du code. En attente de rechargement.\n"
#: supervisor/shared/safe_mode.c
msgid ""
@ -122,39 +122,39 @@ msgstr "'%q' argument requis"
#: py/runtime.c
msgid "'%q' object cannot assign attribute '%q'"
msgstr "object '%q' ne peut assigner l'attribut '%q'"
msgstr "l'objet '%q' ne peut avoir l'attribut '%q'"
#: py/proto.c
msgid "'%q' object does not support '%q'"
msgstr "object '%q' ne supporte pas '%q'"
msgstr "l'objet '%q' ne supporte pas '%q'"
#: py/obj.c
msgid "'%q' object does not support item assignment"
msgstr "objet '%q' ne supporte pas l'assignement d'objets"
msgstr "l'objet '%q' ne supporte pas l'assignement d'objets"
#: py/obj.c
msgid "'%q' object does not support item deletion"
msgstr "object '%q' ne supported pas la suppression d'objet"
msgstr "l'objet '%q' ne supporte pas la suppression d'objet"
#: py/runtime.c
msgid "'%q' object has no attribute '%q'"
msgstr "object '%q' n'as pas d'attribut '%q'"
msgstr "l'objet '%q' n'as pas d'attribut '%q'"
#: py/runtime.c
msgid "'%q' object is not an iterator"
msgstr "object '%q' n'est pas un itérateur"
msgstr "l'objet '%q' n'est pas un itérateur"
#: py/objtype.c py/runtime.c
msgid "'%q' object is not callable"
msgstr "object '%q' ne peut pas être appelé"
msgstr "l'objet '%q' ne peut pas être appelé"
#: py/runtime.c
msgid "'%q' object is not iterable"
msgstr "objet '%q' n'est pas iterable"
msgstr "l'objet '%q' n'est pas itérable"
#: py/obj.c
msgid "'%q' object is not subscriptable"
msgstr "objet '%q' n'est pas souscriptable"
msgstr "l'objet '%q' n'est pas souscriptable"
#: py/emitinlinethumb.c py/emitinlinextensa.c
#, c-format
@ -169,7 +169,7 @@ msgstr "'%s' attend un registre"
#: py/emitinlinethumb.c
#, c-format
msgid "'%s' expects a special register"
msgstr "'%s' attend un registre special"
msgstr "'%s' attend un registre spécial"
#: py/emitinlinethumb.c
#, c-format
@ -256,7 +256,7 @@ msgstr "'return' en dehors d'une fonction"
#: py/compile.c
msgid "'yield from' inside async function"
msgstr ""
msgstr "'yield from' dans une fonction async"
#: py/compile.c
msgid "'yield' outside function"
@ -346,7 +346,7 @@ msgstr "S'annonce déjà."
#: ports/atmel-samd/common-hal/canio/Listener.c
msgid "Already have all-matches listener"
msgstr ""
msgstr "Il y a déjà un auditeur all-matches"
#: shared-module/memorymonitor/AllocationAlarm.c
#: shared-module/memorymonitor/AllocationSize.c
@ -355,7 +355,7 @@ msgstr "Déjà en cours d'exécution"
#: ports/esp32s2/common-hal/wifi/Radio.c
msgid "Already scanning for wifi networks"
msgstr ""
msgstr "Déjà à la recherche des réseaux wifi"
#: ports/cxd56/common-hal/analogio/AnalogIn.c
msgid "AnalogIn not supported on given pin"
@ -706,11 +706,11 @@ msgstr "Impossible de redémarrer PWM"
#: ports/esp32s2/common-hal/neopixel_write/__init__.c
msgid "Could not retrieve clock"
msgstr ""
msgstr "Impossible dobtenir lhorloge"
#: shared-bindings/_bleio/Adapter.c
msgid "Could not set address"
msgstr ""
msgstr "Impossible de définir ladresse"
#: ports/stm/common-hal/pwmio/PWMOut.c
msgid "Could not start PWM"
@ -862,7 +862,7 @@ msgstr "La FFT est définie pour les ndarrays uniquement"
#: ports/esp32s2/common-hal/socketpool/Socket.c
msgid "Failed SSL handshake"
msgstr ""
msgstr "Échec du handshake SSL"
#: shared-bindings/ps2io/Ps2.c
msgid "Failed sending command."
@ -889,11 +889,11 @@ msgstr "Echec de l'allocation de %d octets du tampon RX"
#: ports/esp32s2/common-hal/wifi/__init__.c
msgid "Failed to allocate Wifi memory"
msgstr ""
msgstr "Impossible dallouer la mémoire pour Wifi"
#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c
msgid "Failed to allocate wifi scan memory"
msgstr ""
msgstr "Impossible d'allouer la mémoire pour le scan wifi"
#: ports/nrf/common-hal/_bleio/Adapter.c
msgid "Failed to connect: internal error"
@ -927,16 +927,16 @@ msgstr "Le fichier existe"
#: ports/atmel-samd/common-hal/canio/Listener.c
#: ports/stm/common-hal/canio/Listener.c
msgid "Filters too complex"
msgstr ""
msgstr "Filtre trop complexe"
#: ports/cxd56/common-hal/camera/Camera.c
msgid "Format not supported"
msgstr ""
msgstr "Format non supporté"
#: shared-module/framebufferio/FramebufferDisplay.c
#, c-format
msgid "Framebuffer requires %d bytes"
msgstr ""
msgstr "Le framebuffer nécessite %d octets"
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
msgid "Frequency captured is above capability. Capture Paused."
@ -974,7 +974,7 @@ msgstr "Matériel utilisé, essayez d'autres broches"
#: shared-bindings/wifi/Radio.c
msgid "Hostname must be between 1 and 253 characters"
msgstr ""
msgstr "Hostname doit faire entre 1 et 253 caractères"
#: extmod/vfs_posix_file.c py/objstringio.c
msgid "I/O operation on closed file"
@ -1007,7 +1007,7 @@ msgstr "Taille de tampon incorrecte"
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "Input taking too long"
msgstr ""
msgstr "L'entrée prend trop de temps"
#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c
msgid "Input/output error"
@ -1043,7 +1043,7 @@ msgstr "Broche invalide pour '%q'"
#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c
#: ports/stm/common-hal/sdioio/SDCard.c
msgid "Invalid %q pin selection"
msgstr ""
msgstr "Sélection de pin %q invalide"
#: ports/stm/common-hal/analogio/AnalogIn.c
msgid "Invalid ADC Unit value"
@ -1391,11 +1391,11 @@ msgstr "Ne joue pas"
#: main.c
msgid "Not running saved code.\n"
msgstr ""
msgstr "N'exécute pas le code sauvegardé.\n"
#: shared-bindings/_bleio/__init__.c
msgid "Not settable"
msgstr ""
msgstr "Non réglable"
#: shared-bindings/util.c
msgid ""
@ -1414,11 +1414,11 @@ msgstr "Uniquement 8 ou 16 bit mono avec "
#: ports/esp32s2/common-hal/socketpool/SocketPool.c
msgid "Only IPv4 SOCK_STREAM sockets supported"
msgstr ""
msgstr "Seules les sockets IPv4 SOCK_STREAM sont prises en charge"
#: ports/esp32s2/common-hal/wifi/__init__.c
msgid "Only IPv4 addresses supported"
msgstr ""
msgstr "Seules les adresses IPv4 sont prises en charge"
#: shared-module/displayio/OnDiskBitmap.c
#, c-format
@ -1439,11 +1439,11 @@ msgstr ""
#: shared-bindings/ipaddress/__init__.c
msgid "Only raw int supported for ip"
msgstr ""
msgstr "IP n'accepte que les entiers bruts"
#: ports/esp32s2/common-hal/socketpool/SocketPool.c
msgid "Out of sockets"
msgstr ""
msgstr "Plus de sockets"
#: shared-bindings/audiobusio/PDMIn.c
msgid "Oversample must be multiple of 8."
@ -1518,6 +1518,8 @@ msgid ""
"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle "
"instead"
msgstr ""
"Ce portage n'accepte pas de PWM carrier. Précisez plutôt pin, frequency et "
"duty cycle"
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
@ -1527,6 +1529,8 @@ msgid ""
"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier "
"instead"
msgstr ""
"Ce portage n'accepte pas pins ou frequency. Construisez et passez un PWMOut "
"Carrier à la place"
#: shared-bindings/_bleio/Adapter.c
msgid "Prefix buffer must be on the heap"
@ -1590,7 +1594,7 @@ msgstr "Rafraîchissez trop tôt"
#: shared-bindings/canio/RemoteTransmissionRequest.c
msgid "RemoteTransmissionRequests limited to 8 bytes"
msgstr ""
msgstr "RemoteTransmissionRequests limité à 8 octets"
#: shared-bindings/aesio/aes.c
msgid "Requested AES mode is unsupported"
@ -1606,7 +1610,7 @@ msgstr "L'entrée de ligne 'Row' doit être un digitalio.DigitalInOut"
#: main.c
msgid "Running in safe mode! "
msgstr ""
msgstr "Tourne en mode sécurisé "
#: shared-module/sdcardio/SDCard.c
msgid "SD card CSD format not supported"
@ -1620,12 +1624,12 @@ msgstr "SDA ou SCL a besoin d'une résistance de tirage ('pull up')"
#: ports/stm/common-hal/sdioio/SDCard.c
#, c-format
msgid "SDIO GetCardInfo Error %d"
msgstr ""
msgstr "SDIO GetCardInfo erreur %d"
#: ports/stm/common-hal/sdioio/SDCard.c
#, c-format
msgid "SDIO Init Error %d"
msgstr ""
msgstr "SDIO Init erreur %d"
#: ports/stm/common-hal/busio/SPI.c
msgid "SPI Init Error"
@ -1663,11 +1667,11 @@ msgstr "Sérialiseur en cours d'utilisation"
#: shared-bindings/ssl/SSLContext.c
msgid "Server side context cannot have hostname"
msgstr ""
msgstr "Un contexte niveau serveur ne peut avoir de hostname"
#: ports/cxd56/common-hal/camera/Camera.c
msgid "Size not supported"
msgstr ""
msgstr "Taille non prise en charge"
#: shared-bindings/nvm/ByteArray.c
msgid "Slice and value different lengths."
@ -1682,7 +1686,7 @@ msgstr "Tranches non supportées"
#: ports/esp32s2/common-hal/socketpool/SocketPool.c
msgid "SocketPool can only be used with wifi.radio"
msgstr ""
msgstr "SocketPool ne s'utilise qu'avec wifi.radio"
#: shared-bindings/aesio/aes.c
msgid "Source and destination buffers must be the same length"
@ -1730,7 +1734,7 @@ msgstr ""
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30"
msgstr ""
msgstr "La taille de rgb_pins doit être 6, 12, 18, 24 ou 30"
#: supervisor/shared/safe_mode.c
msgid ""
@ -1785,6 +1789,8 @@ msgstr "Le délai est trop long : le délai maximal est de %d secondes"
msgid ""
"Timer was reserved for internal use - declare PWM pins earlier in the program"
msgstr ""
"Timer est reservé pour un usage interne - déclarez la broche PWM plus tôt "
"dans le programme"
#: supervisor/shared/safe_mode.c
msgid "To exit, please reset the board without "
@ -1865,7 +1871,7 @@ msgstr "Impossible d'allouer des tampons pour une conversion signée"
#: ports/esp32s2/common-hal/busio/I2C.c
msgid "Unable to create lock"
msgstr ""
msgstr "Impossible de créer un verrou"
#: shared-module/displayio/I2CDisplay.c
#, c-format
@ -1896,11 +1902,11 @@ msgstr "Type inattendu pour l'uuid nrfx"
#: ports/esp32s2/common-hal/socketpool/Socket.c
#, c-format
msgid "Unhandled ESP TLS error %d %d %x %d"
msgstr ""
msgstr "Erreur ESP TLS non gérée %d %d %x %d"
#: shared-bindings/wifi/Radio.c
msgid "Unknown failure"
msgstr ""
msgstr "Echec inconnu"
#: ports/nrf/common-hal/_bleio/__init__.c
#, c-format
@ -2020,7 +2026,7 @@ msgstr ""
#: shared-bindings/wifi/Radio.c
msgid "WiFi password must be between 8 and 63 characters"
msgstr ""
msgstr "Le mot de passe WiFi doit faire entre 8 et 63 caractères"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Writes not supported on Characteristic"
@ -2040,7 +2046,7 @@ msgstr "__init__() doit retourner None"
#: py/objtype.c
msgid "__init__() should return None, not '%q'"
msgstr ""
msgstr "__init__() doit retourner None, pas '%q'"
#: py/objobject.c
msgid "__new__ arg must be a user-type"
@ -2085,7 +2091,7 @@ msgstr "l'argument est d'un mauvais type"
#: extmod/ulab/code/linalg/linalg.c
msgid "argument must be ndarray"
msgstr ""
msgstr "l'argument doit être un ndarray"
#: py/argcheck.c shared-bindings/_stage/__init__.c
#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c
@ -2192,7 +2198,7 @@ msgstr "octets > 8 bits non supporté"
#: py/objarray.c
msgid "bytes length not a multiple of item size"
msgstr ""
msgstr "bytes length n'est pas un multiple de la taille d'un élément"
#: py/objstr.c
msgid "bytes value out of range"
@ -2234,7 +2240,7 @@ msgstr "ne peut pas assigner à une expression"
#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c
#: shared-module/_pixelbuf/PixelBuf.c
msgid "can't convert %q to %q"
msgstr ""
msgstr "impossible de convertir %q en %q"
#: py/objstr.c
msgid "can't convert '%q' object to %q implicitly"
@ -2242,7 +2248,7 @@ msgstr "impossible de convertir l'objet '%q' en '%q' implicitement"
#: py/obj.c
msgid "can't convert to %q"
msgstr ""
msgstr "impossible de convertir en %q"
#: py/objstr.c
msgid "can't convert to str implicitly"
@ -2520,11 +2526,11 @@ msgstr "les exceptions doivent dériver de 'BaseException'"
#: shared-bindings/canio/CAN.c
msgid "expected '%q' but got '%q'"
msgstr ""
msgstr "'%q' était attendu, mais reçu '%q'"
#: shared-bindings/canio/CAN.c
msgid "expected '%q' or '%q' but got '%q'"
msgstr ""
msgstr "'%q' ou '%q' était attendu, mais reçu '%q'"
#: py/objstr.c
msgid "expected ':' after format specifier"
@ -2741,7 +2747,7 @@ msgstr "les valeurs initiales doivent être itérables"
#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c
msgid "initial_value length is wrong"
msgstr ""
msgstr "la longueur de initial_value est incorrecte"
#: py/compile.c
msgid "inline assembler must be a function"
@ -2818,7 +2824,7 @@ msgstr "spécification de format invalide"
#: shared-bindings/wifi/Radio.c
msgid "invalid hostname"
msgstr ""
msgstr "hostname incorrect"
#: extmod/modussl_axtls.c
msgid "invalid key"
@ -2945,7 +2951,7 @@ msgstr "max_length doit être 0-%d lorsque fixed_length est %s"
#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c
msgid "max_length must be > 0"
msgstr ""
msgstr "max_length doit être > 0"
#: py/runtime.c
msgid "maximum recursion depth exceeded"
@ -3098,7 +3104,7 @@ msgstr "le nombre de points doit être d'au moins 2"
#: py/obj.c
msgid "object '%q' is not a tuple or list"
msgstr ""
msgstr "l'objet '%q' n'est pas un tuple ou une list"
#: py/obj.c
msgid "object does not support item assignment"
@ -3134,7 +3140,7 @@ msgstr "objet non itérable"
#: py/obj.c
msgid "object of type '%q' has no len()"
msgstr ""
msgstr "len() indéfinie pour un objet de type '%q'"
#: py/obj.c
msgid "object with buffer protocol required"
@ -3187,11 +3193,11 @@ msgstr ""
#: shared-bindings/displayio/Bitmap.c
msgid "out of range of source"
msgstr ""
msgstr "dépassement des bornes de source"
#: shared-bindings/displayio/Bitmap.c
msgid "out of range of target"
msgstr ""
msgstr "dépassement des bornes de target"
#: py/objint_mpz.c
msgid "overflow converting long int to machine word"
@ -3200,7 +3206,7 @@ msgstr "dépassement de capacité en convertissant un entier long en mot machine
#: py/modstruct.c
#, c-format
msgid "pack expected %d items for packing (got %d)"
msgstr ""
msgstr "pack attend %d element(s) (%d reçu)"
#: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c
msgid "palette must be 32 bytes long"
@ -3249,7 +3255,7 @@ msgstr "'pop' d'une entrée PulseIn vide"
#: ports/stm/common-hal/pulseio/PulseIn.c py/objdict.c py/objlist.c py/objset.c
#: shared-bindings/ps2io/Ps2.c
msgid "pop from empty %q"
msgstr ""
msgstr "pop sur %q vide"
#: py/objint_mpz.c
msgid "pow() 3rd argument cannot be 0"
@ -3269,7 +3275,7 @@ msgstr "pow() avec 3 arguments nécessite des entiers"
#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h
#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h
msgid "pressing boot button at start up.\n"
msgstr ""
msgstr "bouton boot appuyé lors du démarrage.\n"
#: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h
#: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h
@ -3277,7 +3283,7 @@ msgstr ""
#: ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h
#: ports/atmel-samd/boards/meowmeow/mpconfigboard.h
msgid "pressing both buttons at start up.\n"
msgstr ""
msgstr "les deux boutons appuyés lors du démarrage.\n"
#: extmod/modutimeq.c
msgid "queue overflow"
@ -3372,7 +3378,7 @@ msgstr "la longueur de sleep ne doit pas être négative"
#: extmod/ulab/code/ndarray.c
msgid "slice step can't be zero"
msgstr ""
msgstr "le pas 'step' de la tranche ne peut être zéro"
#: py/objslice.c py/sequence.c
msgid "slice step cannot be zero"
@ -3392,19 +3398,19 @@ msgstr "l'argument de «sort» doit être un ndarray"
#: extmod/ulab/code/filter/filter.c
msgid "sos array must be of shape (n_section, 6)"
msgstr ""
msgstr "le tableau sos doit être de forme (n_section, 6)"
#: extmod/ulab/code/filter/filter.c
msgid "sos[:, 3] should be all ones"
msgstr ""
msgstr "sos[:, 3] doivent tous être à un"
#: extmod/ulab/code/filter/filter.c
msgid "sosfilt requires iterable arguments"
msgstr ""
msgstr "sosfilt nécessite des argument itératifs"
#: shared-bindings/displayio/Bitmap.c
msgid "source palette too large"
msgstr ""
msgstr "la palette source est trop grande"
#: py/objstr.c
msgid "start/end indices"
@ -3432,7 +3438,7 @@ msgstr "opération de flux non supportée"
#: py/objstrunicode.c
msgid "string indices must be integers, not %q"
msgstr ""
msgstr "les indices d'une chaîne doivent être des entiers, pas %q"
#: py/stream.c
msgid "string not supported; use bytes or bytearray"
@ -3485,11 +3491,11 @@ msgstr "'timeout' doit être >= 0.0"
#: shared-module/sdcardio/SDCard.c
msgid "timeout waiting for v1 card"
msgstr ""
msgstr "Délai dexpiration dépassé en attendant une carte v1"
#: shared-module/sdcardio/SDCard.c
msgid "timeout waiting for v2 card"
msgstr ""
msgstr "Délai dexpiration dépassé en attendant une carte v2"
#: shared-bindings/time/__init__.c
msgid "timestamp out of range for platform time_t"
@ -3510,7 +3516,7 @@ msgstr "trop de valeur à dégrouper (%d attendues)"
#: extmod/ulab/code/approx/approx.c
msgid "trapz is defined for 1D arrays of equal length"
msgstr ""
msgstr "trapz n'est défini que pour des tableaux 1D de longueur égale"
#: extmod/ulab/code/linalg/linalg.c
msgid "tuple index out of range"
@ -3540,7 +3546,7 @@ msgstr "l'objet de type '%q' n'a pas d'attribut '%q'"
#: py/objgenerator.c
msgid "type object 'generator' has no attribute '__await__'"
msgstr ""
msgstr "le type 'generator' n'a pas d'attribut '__await__'"
#: py/objtype.c
msgid "type takes 1 or 3 arguments"
@ -3650,7 +3656,7 @@ msgstr "watchdog timeout doit être supérieur à 0"
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "width must be greater than zero"
msgstr ""
msgstr "width doit être plus grand que zero"
#: shared-bindings/_bleio/Adapter.c
msgid "window must be <= interval"
@ -3702,15 +3708,15 @@ msgstr "'step' nul"
#: extmod/ulab/code/filter/filter.c
msgid "zi must be an ndarray"
msgstr ""
msgstr "zi doit être ndarray"
#: extmod/ulab/code/filter/filter.c
msgid "zi must be of float type"
msgstr ""
msgstr "zi doit être de type float"
#: extmod/ulab/code/filter/filter.c
msgid "zi must be of shape (n_section, 2)"
msgstr ""
msgstr "zi doit être de forme (n_section, 2)"
#~ msgid "Must provide SCK pin"
#~ msgstr "Vous devez fournir un code PIN SCK"

View File

@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: circuitpython-cn\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-10-15 16:06+0530\n"
"PO-Revision-Date: 2020-10-13 17:11+0000\n"
"PO-Revision-Date: 2020-10-17 02:31+0000\n"
"Last-Translator: hexthat <hexthat@gmail.com>\n"
"Language-Team: Chinese Hanyu Pinyin\n"
"Language: zh_Latn_pinyin\n"
@ -15,7 +15,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 4.3-dev\n"
"X-Generator: Weblate 4.3.1-dev\n"
#: main.c
msgid ""
@ -959,7 +959,7 @@ msgstr "Shǐyòng de yìngjiàn, qǐng chángshì qítā yǐn jiǎo"
#: shared-bindings/wifi/Radio.c
msgid "Hostname must be between 1 and 253 characters"
msgstr ""
msgstr "zhǔ jī míng bì xū jiè yú 1 hé 253 gè zì fú zhī jiān"
#: extmod/vfs_posix_file.c py/objstringio.c
msgid "I/O operation on closed file"
@ -2779,7 +2779,7 @@ msgstr "wúxiào de géshì biāozhù"
#: shared-bindings/wifi/Radio.c
msgid "invalid hostname"
msgstr ""
msgstr "wú xiào zhǔ jī míng"
#: extmod/modussl_axtls.c
msgid "invalid key"

View File

@ -121,7 +121,7 @@ $(echo PERIPHERALS_CHIP_FAMILY=$(PERIPHERALS_CHIP_FAMILY))
ifeq ($(DEBUG), 1)
CFLAGS += -ggdb3 -Og
# You may want to disable -flto if it interferes with debugging.
CFLAGS += -flto -flto-partition=none
CFLAGS += -flto
# You may want to enable these flags to make setting breakpoints easier.
# CFLAGS += -fno-inline -fno-ipa-sra
ifeq ($(CHIP_FAMILY), samd21)
@ -144,7 +144,7 @@ else
CFLAGS += -finline-limit=$(CFLAGS_INLINE_LIMIT)
endif
CFLAGS += -flto -flto-partition=none
CFLAGS += -flto
ifeq ($(CIRCUITPY_FULL_BUILD),0)
CFLAGS += --param inline-unit-growth=15 --param max-inline-insns-auto=20
@ -197,6 +197,7 @@ endif
LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs
LDFLAGS += -flto=$(shell nproc)
LIBS := -lgcc -lc
# Use toolchain libm if we're not using our own.

View File

@ -35,9 +35,6 @@
#define IGNORE_PIN_PA12 1
#define IGNORE_PIN_PA15 1
#define IGNORE_PIN_PA16 1
#define IGNORE_PIN_PA21 1
#define IGNORE_PIN_PA22 1
#define IGNORE_PIN_PA23 1
#define IGNORE_PIN_PA27 1
#define IGNORE_PIN_PA28 1

View File

@ -44,26 +44,36 @@
#include "hpl/pm/hpl_pm_base.h"
#endif
#define HAVE_ANALOGOUT ( \
(defined(PIN_PA02) && !defined(IGNORE_PA02)) || \
(defined(SAM_D5X_E5X) && defined(PIN_PA05) && !defined(IGNORE_PA05)) \
)
void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self,
const mcu_pin_obj_t *pin) {
#if defined(SAMD21) && !defined(PIN_PA02)
#if !HAVE_ANALOGOUT
mp_raise_NotImplementedError(translate("No DAC on chip"));
#else
if (pin->number != PIN_PA02
#ifdef SAM_D5X_E5X
&& pin->number != PIN_PA05
int channel = -1;
#if defined(PIN_PA02) && !defined(IGNORE_PIN_PA02)
if (pin->number != PIN_PA02) {
channel = 0;
}
#endif
) {
#if defined(PIN_PA05) && defined(PIN_PA05) && !defined(IGNORE_PIN_PA05)
if (pin->number != PIN_PA05) {
channel = 1;
}
#endif
if(channel == -1) {
mp_raise_ValueError(translate("AnalogOut not supported on given pin"));
return;
}
self->channel = 0;
#ifdef SAM_D5X_E5X
if (pin->number == PIN_PA05) {
self->channel = 1;
}
#endif
self->channel = channel;
#ifdef SAM_D5X_E5X
hri_mclk_set_APBDMASK_DAC_bit(MCLK);
@ -105,11 +115,15 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self,
}
bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) {
#if !HAVE_ANALOGOUT
return false;
#else
return self->deinited;
#endif
}
void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) {
#if (defined(SAMD21) && defined(PIN_PA02)) || defined(SAM_D5X_E5X)
#if HAVE_ANALOGOUT
if (common_hal_analogio_analogout_deinited(self)) {
return;
}
@ -130,12 +144,11 @@ void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) {
void common_hal_analogio_analogout_set_value(analogio_analogout_obj_t *self,
uint16_t value) {
#if defined(SAMD21) && !defined(PIN_PA02)
return;
#endif
#if HAVE_ANALOGOUT
// Input is 16 bit so make sure and set LEFTADJ to 1 so it takes the top
// bits. This is currently done in asf4_conf/*/hpl_dac_config.h.
dac_sync_write(&self->descriptor, self->channel, &value, 1);
#endif
}
void analogout_reset(void) {
@ -143,7 +156,7 @@ void analogout_reset(void) {
// if it was enabled, so do that instead if AudioOut is enabled.
#if CIRCUITPY_AUDIOIO
audioout_reset();
#else
#elif HAVE_ANALOGOUT
#ifdef SAMD21
while (DAC->STATUS.reg & DAC_STATUS_SYNCBUSY) {}
#endif

View File

@ -223,9 +223,11 @@ bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t* pin) {
#ifdef MICROPY_HW_NEOPIXEL
if (pin == MICROPY_HW_NEOPIXEL) {
// Special case for Metro M0 where the NeoPixel is also SWCLK
#ifndef IGNORE_PIN_PA30
if (MICROPY_HW_NEOPIXEL == &pin_PA30 && DSU->STATUSB.bit.DBGPRES == 1) {
return false;
}
#endif
return !neopixel_in_use;
}
#endif

View File

@ -275,120 +275,119 @@ STATIC const mp_rom_map_elem_t mcu_pin_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_PB31), MP_ROM_PTR(&pin_PB31) },
#endif
// These are SAMD51 specific so we assume we want them in RAM
#if defined(PIN_PC00)
#if defined(PIN_PC00) && !defined(IGNORE_PIN_PC00)
{ MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) },
#endif
#if defined(PIN_PC01)
#if defined(PIN_PC01) && !defined(IGNORE_PIN_PC01)
{ MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) },
#endif
#if defined(PIN_PC02)
#if defined(PIN_PC02) && !defined(IGNORE_PIN_PC02)
{ MP_ROM_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) },
#endif
#if defined(PIN_PC03)
#if defined(PIN_PC03) && !defined(IGNORE_PIN_PC03)
{ MP_ROM_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) },
#endif
#if defined(PIN_PC04)
#if defined(PIN_PC04) && !defined(IGNORE_PIN_PC04)
{ MP_ROM_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) },
#endif
#if defined(PIN_PC05)
#if defined(PIN_PC05) && !defined(IGNORE_PIN_PC05)
{ MP_ROM_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) },
#endif
#if defined(PIN_PC06)
#if defined(PIN_PC06) && !defined(IGNORE_PIN_PC06)
{ MP_ROM_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) },
#endif
#if defined(PIN_PC07)
#if defined(PIN_PC07) && !defined(IGNORE_PIN_PC07)
{ MP_ROM_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) },
#endif
#if defined(PIN_PC10)
#if defined(PIN_PC10) && !defined(IGNORE_PIN_PC10)
{ MP_ROM_QSTR(MP_QSTR_PC10), MP_ROM_PTR(&pin_PC10) },
#endif
#if defined(PIN_PC11)
#if defined(PIN_PC11) && !defined(IGNORE_PIN_PC11)
{ MP_ROM_QSTR(MP_QSTR_PC11), MP_ROM_PTR(&pin_PC11) },
#endif
#if defined(PIN_PC12)
#if defined(PIN_PC12) && !defined(IGNORE_PIN_PC12)
{ MP_ROM_QSTR(MP_QSTR_PC12), MP_ROM_PTR(&pin_PC12) },
#endif
#if defined(PIN_PC13)
#if defined(PIN_PC13) && !defined(IGNORE_PIN_PC13)
{ MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) },
#endif
#if defined(PIN_PC14)
#if defined(PIN_PC14) && !defined(IGNORE_PIN_PC14)
{ MP_ROM_QSTR(MP_QSTR_PC14), MP_ROM_PTR(&pin_PC14) },
#endif
#if defined(PIN_PC15)
#if defined(PIN_PC15) && !defined(IGNORE_PIN_PC15)
{ MP_ROM_QSTR(MP_QSTR_PC15), MP_ROM_PTR(&pin_PC15) },
#endif
#if defined(PIN_PC16)
#if defined(PIN_PC16) && !defined(IGNORE_PIN_PC16)
{ MP_ROM_QSTR(MP_QSTR_PC16), MP_ROM_PTR(&pin_PC16) },
#endif
#if defined(PIN_PC17)
#if defined(PIN_PC17) && !defined(IGNORE_PIN_PC17)
{ MP_ROM_QSTR(MP_QSTR_PC17), MP_ROM_PTR(&pin_PC17) },
#endif
#if defined(PIN_PC18)
#if defined(PIN_PC18) && !defined(IGNORE_PIN_PC18)
{ MP_ROM_QSTR(MP_QSTR_PC18), MP_ROM_PTR(&pin_PC18) },
#endif
#if defined(PIN_PC19)
#if defined(PIN_PC19) && !defined(IGNORE_PIN_PC19)
{ MP_ROM_QSTR(MP_QSTR_PC19), MP_ROM_PTR(&pin_PC19) },
#endif
#if defined(PIN_PC20)
#if defined(PIN_PC20) && !defined(IGNORE_PIN_PC20)
{ MP_ROM_QSTR(MP_QSTR_PC20), MP_ROM_PTR(&pin_PC20) },
#endif
#if defined(PIN_PC21)
#if defined(PIN_PC21) && !defined(IGNORE_PIN_PC21)
{ MP_ROM_QSTR(MP_QSTR_PC21), MP_ROM_PTR(&pin_PC21) },
#endif
#if defined(PIN_PC22)
#if defined(PIN_PC22) && !defined(IGNORE_PIN_PC22)
{ MP_ROM_QSTR(MP_QSTR_PC22), MP_ROM_PTR(&pin_PC22) },
#endif
#if defined(PIN_PC23)
#if defined(PIN_PC23) && !defined(IGNORE_PIN_PC23)
{ MP_ROM_QSTR(MP_QSTR_PC23), MP_ROM_PTR(&pin_PC23) },
#endif
#if defined(PIN_PC24)
#if defined(PIN_PC24) && !defined(IGNORE_PIN_PC24)
{ MP_ROM_QSTR(MP_QSTR_PC24), MP_ROM_PTR(&pin_PC24) },
#endif
#if defined(PIN_PC25)
#if defined(PIN_PC25) && !defined(IGNORE_PIN_PC25)
{ MP_ROM_QSTR(MP_QSTR_PC25), MP_ROM_PTR(&pin_PC25) },
#endif
#if defined(PIN_PC26)
#if defined(PIN_PC26) && !defined(IGNORE_PIN_PC26)
{ MP_ROM_QSTR(MP_QSTR_PC26), MP_ROM_PTR(&pin_PC26) },
#endif
#if defined(PIN_PC27)
#if defined(PIN_PC27) && !defined(IGNORE_PIN_PC27)
{ MP_ROM_QSTR(MP_QSTR_PC27), MP_ROM_PTR(&pin_PC27) },
#endif
#if defined(PIN_PC28)
#if defined(PIN_PC28) && !defined(IGNORE_PIN_PC28)
{ MP_ROM_QSTR(MP_QSTR_PC28), MP_ROM_PTR(&pin_PC28) },
#endif
#if defined(PIN_PC30)
#if defined(PIN_PC30) && !defined(IGNORE_PIN_PC30)
{ MP_ROM_QSTR(MP_QSTR_PC30), MP_ROM_PTR(&pin_PC30) },
#endif
#if defined(PIN_PC31)
#if defined(PIN_PC31) && !defined(IGNORE_PIN_PC31)
{ MP_ROM_QSTR(MP_QSTR_PC31), MP_ROM_PTR(&pin_PC31) },
#endif
#if defined(PIN_PD00)
#if defined(PIN_PD00) && !defined(IGNORE_PIN_PD00)
{ MP_ROM_QSTR(MP_QSTR_PD00), MP_ROM_PTR(&pin_PD00) },
#endif
#if defined(PIN_PD01)
#if defined(PIN_PD01) && !defined(IGNORE_PIN_PD01)
{ MP_ROM_QSTR(MP_QSTR_PD01), MP_ROM_PTR(&pin_PD01) },
#endif
#if defined(PIN_PD08)
#if defined(PIN_PD08) && !defined(IGNORE_PIN_PD08)
{ MP_ROM_QSTR(MP_QSTR_PD08), MP_ROM_PTR(&pin_PD08) },
#endif
#if defined(PIN_PD09)
#if defined(PIN_PD09) && !defined(IGNORE_PIN_PD09)
{ MP_ROM_QSTR(MP_QSTR_PD09), MP_ROM_PTR(&pin_PD09) },
#endif
#if defined(PIN_PD10)
#if defined(PIN_PD10) && !defined(IGNORE_PIN_PD10)
{ MP_ROM_QSTR(MP_QSTR_PD10), MP_ROM_PTR(&pin_PD10) },
#endif
#if defined(PIN_PD11)
#if defined(PIN_PD11) && !defined(IGNORE_PIN_PD11)
{ MP_ROM_QSTR(MP_QSTR_PD11), MP_ROM_PTR(&pin_PD11) },
#endif
#if defined(PIN_PD12)
#if defined(PIN_PD12) && !defined(IGNORE_PIN_PD12)
{ MP_ROM_QSTR(MP_QSTR_PD12), MP_ROM_PTR(&pin_PD12) },
#endif
#if defined(PIN_PD20)
#if defined(PIN_PD20) && !defined(IGNORE_PIN_PD20)
{ MP_ROM_QSTR(MP_QSTR_PD20), MP_ROM_PTR(&pin_PD20) },
#endif
#if defined(PIN_PD21)
#if defined(PIN_PD21) && !defined(IGNORE_PIN_PD21)
{ MP_ROM_QSTR(MP_QSTR_PD21), MP_ROM_PTR(&pin_PD21) },
#endif
};

View File

@ -46,11 +46,11 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) },
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO38) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO38) },
{ MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) },
{ MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO38) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO33) },
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO33) },
{ MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) },
{ MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO33) },

View File

@ -25,6 +25,7 @@
*/
#include "shared-bindings/wifi/Radio.h"
#include "shared-bindings/wifi/Network.h"
#include <string.h>
@ -38,6 +39,8 @@
#include "components/esp_wifi/include/esp_wifi.h"
#include "components/lwip/include/apps/ping/ping_sock.h"
#define MAC_ADDRESS_LENGTH 6
static void start_station(wifi_radio_obj_t *self) {
if (self->sta_mode) {
return;
@ -50,6 +53,8 @@ static void start_station(wifi_radio_obj_t *self) {
}
esp_wifi_set_mode(next_mode);
self->sta_mode = 1;
esp_wifi_set_config(WIFI_MODE_STA, &self->sta_config);
}
@ -73,8 +78,6 @@ void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabled) {
}
}
#define MAC_ADDRESS_LENGTH 6
mp_obj_t common_hal_wifi_radio_get_mac_address(wifi_radio_obj_t *self) {
uint8_t mac[MAC_ADDRESS_LENGTH];
esp_wifi_get_mac(ESP_IF_WIFI_STA, mac);
@ -162,13 +165,66 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t
return WIFI_RADIO_ERROR_NONE;
}
mp_obj_t common_hal_wifi_radio_get_ap_info(wifi_radio_obj_t *self) {
if (!esp_netif_is_netif_up(self->netif)) {
return mp_const_none;
}
// Make sure the interface is in STA mode
if (!self->sta_mode){
return mp_const_none;
}
wifi_network_obj_t *ap_info = m_new_obj(wifi_network_obj_t);
ap_info->base.type = &wifi_network_type;
// From esp_wifi.h, the possible return values (typos theirs):
// ESP_OK: succeed
// ESP_ERR_WIFI_CONN: The station interface don't initialized
// ESP_ERR_WIFI_NOT_CONNECT: The station is in disconnect status
if (esp_wifi_sta_get_ap_info(&self->ap_info.record) != ESP_OK){
return mp_const_none;
} else {
memcpy(&ap_info->record, &self->ap_info.record, sizeof(wifi_ap_record_t));
return MP_OBJ_FROM_PTR(ap_info);
}
}
mp_obj_t common_hal_wifi_radio_get_ipv4_gateway(wifi_radio_obj_t *self) {
if (!esp_netif_is_netif_up(self->netif)) {
return mp_const_none;
}
esp_netif_get_ip_info(self->netif, &self->ip_info);
return common_hal_ipaddress_new_ipv4address(self->ip_info.gw.addr);
}
mp_obj_t common_hal_wifi_radio_get_ipv4_subnet(wifi_radio_obj_t *self) {
if (!esp_netif_is_netif_up(self->netif)) {
return mp_const_none;
}
esp_netif_get_ip_info(self->netif, &self->ip_info);
return common_hal_ipaddress_new_ipv4address(self->ip_info.netmask.addr);
}
mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self) {
if (!esp_netif_is_netif_up(self->netif)) {
return mp_const_none;
}
esp_netif_ip_info_t ip_info;
esp_netif_get_ip_info(self->netif, &ip_info);
return common_hal_ipaddress_new_ipv4address(ip_info.ip.addr);
esp_netif_get_ip_info(self->netif, &self->ip_info);
return common_hal_ipaddress_new_ipv4address(self->ip_info.ip.addr);
}
mp_obj_t common_hal_wifi_radio_get_ipv4_dns(wifi_radio_obj_t *self) {
if (!esp_netif_is_netif_up(self->netif)) {
return mp_const_none;
}
esp_netif_get_dns_info(self->netif, ESP_NETIF_DNS_MAIN, &self->dns_info);
// dns_info is of type esp_netif_dns_info_t, which is just ever so slightly
// different than esp_netif_ip_info_t used for
// common_hal_wifi_radio_get_ipv4_address (includes both ipv4 and 6),
// so some extra jumping is required to get to the actual address
return common_hal_ipaddress_new_ipv4address(self->dns_info.ip.u_addr.ip4.addr);
}
mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address, mp_float_t timeout) {

View File

@ -32,6 +32,7 @@
#include "components/esp_event/include/esp_event.h"
#include "shared-bindings/wifi/ScannedNetworks.h"
#include "shared-bindings/wifi/Network.h"
// Event bits for the Radio event group.
#define WIFI_SCAN_DONE_BIT BIT0
@ -46,6 +47,9 @@ typedef struct {
StaticEventGroup_t event_group;
EventGroupHandle_t event_group_handle;
wifi_config_t sta_config;
wifi_network_obj_t ap_info;
esp_netif_ip_info_t ip_info;
esp_netif_dns_info_t dns_info;
esp_netif_t *netif;
bool started;
bool ap_mode;

View File

@ -257,6 +257,9 @@ STATIC mp_obj_t socketpool_socket_recv_into(size_t n_args, const mp_obj_t *args)
mp_int_t len = bufinfo.len;
if (n_args == 3) {
mp_int_t given_len = mp_obj_get_int(args[2]);
if (given_len > len) {
mp_raise_ValueError(translate("buffer too small for requested bytes"));
}
if (given_len > 0 && given_len < len) {
len = given_len;
}

View File

@ -203,6 +203,38 @@ STATIC mp_obj_t wifi_radio_connect(size_t n_args, const mp_obj_t *pos_args, mp_m
}
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wifi_radio_connect_obj, 1, wifi_radio_connect);
//| ipv4_gateway: Optional[ipaddress.IPv4Address]
//| """IP v4 Address of the gateway when connected to an access point. None otherwise."""
//|
STATIC mp_obj_t wifi_radio_get_ipv4_gateway(mp_obj_t self) {
return common_hal_wifi_radio_get_ipv4_gateway(self);
}
MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_gateway_obj, wifi_radio_get_ipv4_gateway);
const mp_obj_property_t wifi_radio_ipv4_gateway_obj = {
.base.type = &mp_type_property,
.proxy = { (mp_obj_t)&wifi_radio_get_ipv4_gateway_obj,
(mp_obj_t)&mp_const_none_obj,
(mp_obj_t)&mp_const_none_obj },
};
//| ipv4_subnet: Optional[ipaddress.IPv4Address]
//| """IP v4 Address of the subnet when connected to an access point. None otherwise."""
//|
STATIC mp_obj_t wifi_radio_get_ipv4_subnet(mp_obj_t self) {
return common_hal_wifi_radio_get_ipv4_subnet(self);
}
MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_subnet_obj, wifi_radio_get_ipv4_subnet);
const mp_obj_property_t wifi_radio_ipv4_subnet_obj = {
.base.type = &mp_type_property,
.proxy = { (mp_obj_t)&wifi_radio_get_ipv4_subnet_obj,
(mp_obj_t)&mp_const_none_obj,
(mp_obj_t)&mp_const_none_obj },
};
//| ipv4_address: Optional[ipaddress.IPv4Address]
//| """IP v4 Address of the radio when connected to an access point. None otherwise."""
//|
@ -219,6 +251,38 @@ const mp_obj_property_t wifi_radio_ipv4_address_obj = {
(mp_obj_t)&mp_const_none_obj },
};
//| ipv4_dns: Optional[ipaddress.IPv4Address]
//| """IP v4 Address of the DNS server in use when connected to an access point. None otherwise."""
//|
STATIC mp_obj_t wifi_radio_get_ipv4_dns(mp_obj_t self) {
return common_hal_wifi_radio_get_ipv4_dns(self);
}
MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_dns_obj, wifi_radio_get_ipv4_dns);
const mp_obj_property_t wifi_radio_ipv4_dns_obj = {
.base.type = &mp_type_property,
.proxy = { (mp_obj_t)&wifi_radio_get_ipv4_dns_obj,
(mp_obj_t)&mp_const_none_obj,
(mp_obj_t)&mp_const_none_obj },
};
//| ap_info: Optional[Network]
//| """Network object containing BSSID, SSID, channel, and RSSI when connected to an access point. None otherwise."""
//|
STATIC mp_obj_t wifi_radio_get_ap_info(mp_obj_t self) {
return common_hal_wifi_radio_get_ap_info(self);
}
MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ap_info_obj, wifi_radio_get_ap_info);
const mp_obj_property_t wifi_radio_ap_info_obj = {
.base.type = &mp_type_property,
.proxy = { (mp_obj_t)&wifi_radio_get_ap_info_obj,
(mp_obj_t)&mp_const_none_obj,
(mp_obj_t)&mp_const_none_obj },
};
//| def ping(self, ip, *, timeout: float = 0.5) -> float:
//| """Ping an IP to test connectivity. Returns echo time in seconds.
//| Returns None when it times out."""
@ -261,6 +325,10 @@ STATIC const mp_rom_map_elem_t wifi_radio_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&wifi_radio_connect_obj) },
// { MP_ROM_QSTR(MP_QSTR_connect_to_enterprise), MP_ROM_PTR(&wifi_radio_connect_to_enterprise_obj) },
{ MP_ROM_QSTR(MP_QSTR_ap_info), MP_ROM_PTR(&wifi_radio_ap_info_obj) },
{ MP_ROM_QSTR(MP_QSTR_ipv4_dns), MP_ROM_PTR(&wifi_radio_ipv4_dns_obj) },
{ MP_ROM_QSTR(MP_QSTR_ipv4_gateway), MP_ROM_PTR(&wifi_radio_ipv4_gateway_obj) },
{ MP_ROM_QSTR(MP_QSTR_ipv4_subnet), MP_ROM_PTR(&wifi_radio_ipv4_subnet_obj) },
{ MP_ROM_QSTR(MP_QSTR_ipv4_address), MP_ROM_PTR(&wifi_radio_ipv4_address_obj) },
// { MP_ROM_QSTR(MP_QSTR_access_point_active), MP_ROM_PTR(&wifi_radio_access_point_active_obj) },

View File

@ -55,6 +55,10 @@ extern void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self)
extern wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t* ssid, size_t ssid_len, uint8_t* password, size_t password_len, uint8_t channel, mp_float_t timeout, uint8_t* bssid, size_t bssid_len);
extern mp_obj_t common_hal_wifi_radio_get_ap_info(wifi_radio_obj_t *self);
extern mp_obj_t common_hal_wifi_radio_get_ipv4_dns(wifi_radio_obj_t *self);
extern mp_obj_t common_hal_wifi_radio_get_ipv4_gateway(wifi_radio_obj_t *self);
extern mp_obj_t common_hal_wifi_radio_get_ipv4_subnet(wifi_radio_obj_t *self);
extern mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self);
extern mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address, mp_float_t timeout);

View File

@ -33,6 +33,14 @@
#define CIRCUITPY_SUPERVISOR_ALLOC_COUNT (12)
// Using a zero length to mark an unused allocation makes the code a bit shorter (but makes it
// impossible to support zero-length allocations).
#define FREE 0
// The lowest two bits of a valid length are always zero, so we can use them to mark an allocation
// as freed by the client but not yet reclaimed into the FREE middle.
#define HOLE 1
static supervisor_allocation allocations[CIRCUITPY_SUPERVISOR_ALLOC_COUNT];
// We use uint32_t* to ensure word (4 byte) alignment.
uint32_t* low_address;
@ -61,25 +69,31 @@ void free_memory(supervisor_allocation* allocation) {
}
if (allocation->ptr == high_address) {
high_address += allocation->length / 4;
allocation->length = FREE;
for (index++; index < CIRCUITPY_SUPERVISOR_ALLOC_COUNT; index++) {
if (allocations[index].ptr != NULL) {
if (!(allocations[index].length & HOLE)) {
break;
}
// Division automatically shifts out the HOLE bit.
high_address += allocations[index].length / 4;
allocations[index].length = FREE;
}
} else if (allocation->ptr + allocation->length / 4 == low_address) {
low_address = allocation->ptr;
allocation->length = FREE;
for (index--; index >= 0; index--) {
if (allocations[index].ptr != NULL) {
if (!(allocations[index].length & HOLE)) {
break;
}
low_address -= allocations[index].length / 4;
allocations[index].length = FREE;
}
} else {
// Freed memory isn't in the middle so skip updating bounds. The memory will be added to the
// middle when the memory to the inside is freed.
// middle when the memory to the inside is freed. We still need its length, but setting
// only the lowest bit is nondestructive.
allocation->length |= HOLE;
}
allocation->ptr = NULL;
}
supervisor_allocation* allocation_from_ptr(void *ptr) {
@ -99,7 +113,7 @@ supervisor_allocation* allocate_remaining_memory(void) {
}
supervisor_allocation* allocate_memory(uint32_t length, bool high) {
if ((high_address - low_address) * 4 < (int32_t) length || length % 4 != 0) {
if (length == 0 || length % 4 != 0) {
return NULL;
}
uint8_t index = 0;
@ -108,15 +122,21 @@ supervisor_allocation* allocate_memory(uint32_t length, bool high) {
index = CIRCUITPY_SUPERVISOR_ALLOC_COUNT - 1;
direction = -1;
}
supervisor_allocation* alloc;
for (; index < CIRCUITPY_SUPERVISOR_ALLOC_COUNT; index += direction) {
if (allocations[index].ptr == NULL) {
alloc = &allocations[index];
if (alloc->length == FREE && (high_address - low_address) * 4 >= (int32_t) length) {
break;
}
// If a hole matches in length exactly, we can reuse it.
if (alloc->length == (length | HOLE)) {
alloc->length = length;
return alloc;
}
}
if (index >= CIRCUITPY_SUPERVISOR_ALLOC_COUNT) {
return NULL;
}
supervisor_allocation* alloc = &allocations[index];
if (high) {
high_address -= length / 4;
alloc->ptr = high_address;