Merge remote-tracking branch 'origin/master' into ulab

This commit is contained in:
Jeff Epler 2020-03-03 20:13:53 -06:00
commit da31acfcc4
30 changed files with 481 additions and 132 deletions

View File

@ -273,13 +273,3 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
- name: Install upload deps
run: |
pip install uritemplate
- name: Upload to Release
run: "[ -z \"$ADABOT_GITHUB_ACCESS_TOKEN\" ] || python3 -u upload_release_files.py"
working-directory: tools
env:
UPLOAD_URL: ${{ github.event.release.upload_url }}
ADABOT_GITHUB_ACCESS_TOKEN: ${{ secrets.BLINKA_GITHUB_ACCESS_TOKEN }}
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')

View File

@ -3382,11 +3382,7 @@ FRESULT f_read (
if (!sect) ABORT(fs, FR_INT_ERR);
sect += csect;
cc = btr / SS(fs); /* When remaining bytes >= sector size, */
if (cc
#if _FS_DISK_READ_ALIGNED
&& (((int)rbuff & 3) == 0)
#endif
) {/* Read maximum contiguous sectors directly */
if (cc) {/* Read maximum contiguous sectors directly */
if (csect + cc > fs->csize) { /* Clip at cluster boundary */
cc = fs->csize - csect;
}

View File

@ -343,12 +343,6 @@
/ SemaphoreHandle_t and etc.. A header file for O/S definitions needs to be
/ included somewhere in the scope of ff.h. */
// Set to nonzero if buffers passed to disk_read have a word alignment
// restriction
#ifndef _FS_DISK_READ_ALIGNED
#define _FS_DISK_READ_ALIGNED 0
#endif
/* #include <windows.h> // O/S definitions */

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-27 11:02-0600\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\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"
@ -184,6 +184,10 @@ msgstr ""
msgid "'align' requires 1 argument"
msgstr "'align' membutuhkan 1 argumen"
#: py/compile.c
msgid "'async for' or 'async with' outside async function"
msgstr ""
#: py/compile.c
msgid "'await' outside function"
msgstr "'await' diluar fungsi"
@ -910,10 +914,13 @@ msgstr "Pin untuk channel kanan tidak valid"
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c
#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c
#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins"
msgstr "Pin-pin tidak valid"
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins for PWMOut"
msgstr ""
#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c
msgid "Invalid polarity"
msgstr ""
@ -1003,6 +1010,10 @@ msgstr ""
msgid "Must provide MISO or MOSI pin"
msgstr ""
#: py/parse.c
msgid "Name too long"
msgstr ""
#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "Negative step not supported"
msgstr ""
@ -1181,7 +1192,7 @@ msgid "PulseIn not yet supported"
msgstr ""
#: ports/stm32f4/common-hal/pulseio/PulseOut.c
msgid "PulseOut not yet supported"
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm32f4/common-hal/os/__init__.c
@ -2216,7 +2227,7 @@ msgstr ""
msgid "inline assembler must be a function"
msgstr "inline assembler harus sebuah fungsi"
#: extmod/ulab/code/linalg.c
#: extmod/ulab/code/create.c
msgid "input argument must be an integer or a 2-tuple"
msgstr ""
@ -2539,7 +2550,7 @@ msgstr ""
msgid "number of arguments must be 2, or 3"
msgstr ""
#: extmod/ulab/code/numerical.c
#: extmod/ulab/code/create.c
msgid "number of points must be at least 2"
msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-27 11:02-0600\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\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"
@ -183,6 +183,10 @@ msgstr ""
msgid "'align' requires 1 argument"
msgstr ""
#: py/compile.c
msgid "'async for' or 'async with' outside async function"
msgstr ""
#: py/compile.c
msgid "'await' outside function"
msgstr ""
@ -899,10 +903,13 @@ msgstr ""
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c
#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c
#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins"
msgstr ""
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins for PWMOut"
msgstr ""
#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c
msgid "Invalid polarity"
msgstr ""
@ -992,6 +999,10 @@ msgstr ""
msgid "Must provide MISO or MOSI pin"
msgstr ""
#: py/parse.c
msgid "Name too long"
msgstr ""
#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "Negative step not supported"
msgstr ""
@ -1167,7 +1178,7 @@ msgid "PulseIn not yet supported"
msgstr ""
#: ports/stm32f4/common-hal/pulseio/PulseOut.c
msgid "PulseOut not yet supported"
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm32f4/common-hal/os/__init__.c
@ -2192,7 +2203,7 @@ msgstr ""
msgid "inline assembler must be a function"
msgstr ""
#: extmod/ulab/code/linalg.c
#: extmod/ulab/code/create.c
msgid "input argument must be an integer or a 2-tuple"
msgstr ""
@ -2515,7 +2526,7 @@ msgstr ""
msgid "number of arguments must be 2, or 3"
msgstr ""
#: extmod/ulab/code/numerical.c
#: extmod/ulab/code/create.c
msgid "number of points must be at least 2"
msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-27 11:02-0600\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2018-07-27 11:55-0700\n"
"Last-Translator: Pascal Deneaux\n"
"Language-Team: Sebastian Plamauer, Pascal Deneaux\n"
@ -185,6 +185,10 @@ msgstr "'S' und 'O' sind keine unterstützten Formattypen"
msgid "'align' requires 1 argument"
msgstr "'align' erfordert genau ein Argument"
#: py/compile.c
msgid "'async for' or 'async with' outside async function"
msgstr ""
#: py/compile.c
msgid "'await' outside function"
msgstr "'await' außerhalb einer Funktion"
@ -907,10 +911,13 @@ msgstr "Ungültiger Pin für rechten Kanal"
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c
#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c
#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins"
msgstr "Ungültige Pins"
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins for PWMOut"
msgstr ""
#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c
msgid "Invalid polarity"
msgstr "Ungültige Polarität"
@ -1001,6 +1008,10 @@ msgstr "Muss eine %q Unterklasse sein."
msgid "Must provide MISO or MOSI pin"
msgstr ""
#: py/parse.c
msgid "Name too long"
msgstr ""
#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "Negative step not supported"
msgstr ""
@ -1184,7 +1195,7 @@ msgid "PulseIn not yet supported"
msgstr ""
#: ports/stm32f4/common-hal/pulseio/PulseOut.c
msgid "PulseOut not yet supported"
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm32f4/common-hal/os/__init__.c
@ -2222,7 +2233,7 @@ msgstr ""
msgid "inline assembler must be a function"
msgstr "inline assembler muss eine function sein"
#: extmod/ulab/code/linalg.c
#: extmod/ulab/code/create.c
msgid "input argument must be an integer or a 2-tuple"
msgstr ""
@ -2551,7 +2562,7 @@ msgstr ""
msgid "number of arguments must be 2, or 3"
msgstr ""
#: extmod/ulab/code/numerical.c
#: extmod/ulab/code/create.c
msgid "number of points must be at least 2"
msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-27 11:02-0600\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2018-07-27 11:55-0700\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -183,6 +183,10 @@ msgstr ""
msgid "'align' requires 1 argument"
msgstr ""
#: py/compile.c
msgid "'async for' or 'async with' outside async function"
msgstr ""
#: py/compile.c
msgid "'await' outside function"
msgstr ""
@ -899,10 +903,13 @@ msgstr ""
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c
#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c
#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins"
msgstr ""
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins for PWMOut"
msgstr ""
#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c
msgid "Invalid polarity"
msgstr ""
@ -992,6 +999,10 @@ msgstr ""
msgid "Must provide MISO or MOSI pin"
msgstr ""
#: py/parse.c
msgid "Name too long"
msgstr ""
#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "Negative step not supported"
msgstr ""
@ -1167,7 +1178,7 @@ msgid "PulseIn not yet supported"
msgstr ""
#: ports/stm32f4/common-hal/pulseio/PulseOut.c
msgid "PulseOut not yet supported"
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm32f4/common-hal/os/__init__.c
@ -2192,7 +2203,7 @@ msgstr ""
msgid "inline assembler must be a function"
msgstr ""
#: extmod/ulab/code/linalg.c
#: extmod/ulab/code/create.c
msgid "input argument must be an integer or a 2-tuple"
msgstr ""
@ -2515,7 +2526,7 @@ msgstr ""
msgid "number of arguments must be 2, or 3"
msgstr ""
#: extmod/ulab/code/numerical.c
#: extmod/ulab/code/create.c
msgid "number of points must be at least 2"
msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-27 11:02-0600\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2018-07-27 11:55-0700\n"
"Last-Translator: \n"
"Language-Team: @sommersoft, @MrCertainly\n"
@ -185,6 +185,10 @@ msgstr ""
msgid "'align' requires 1 argument"
msgstr ""
#: py/compile.c
msgid "'async for' or 'async with' outside async function"
msgstr ""
#: py/compile.c
msgid "'await' outside function"
msgstr ""
@ -903,10 +907,13 @@ msgstr "Belay that! Invalid pin for starboard-side channel"
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c
#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c
#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins"
msgstr ""
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins for PWMOut"
msgstr ""
#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c
msgid "Invalid polarity"
msgstr ""
@ -996,6 +1003,10 @@ msgstr ""
msgid "Must provide MISO or MOSI pin"
msgstr ""
#: py/parse.c
msgid "Name too long"
msgstr ""
#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "Negative step not supported"
msgstr ""
@ -1171,7 +1182,7 @@ msgid "PulseIn not yet supported"
msgstr ""
#: ports/stm32f4/common-hal/pulseio/PulseOut.c
msgid "PulseOut not yet supported"
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm32f4/common-hal/os/__init__.c
@ -2196,7 +2207,7 @@ msgstr ""
msgid "inline assembler must be a function"
msgstr ""
#: extmod/ulab/code/linalg.c
#: extmod/ulab/code/create.c
msgid "input argument must be an integer or a 2-tuple"
msgstr ""
@ -2519,7 +2530,7 @@ msgstr ""
msgid "number of arguments must be 2, or 3"
msgstr ""
#: extmod/ulab/code/numerical.c
#: extmod/ulab/code/create.c
msgid "number of points must be at least 2"
msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-27 11:02-0600\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2018-08-24 22:56-0500\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -185,6 +185,10 @@ msgstr "'S' y 'O' no son compatibles con los tipos de formato"
msgid "'align' requires 1 argument"
msgstr "'align' requiere 1 argumento"
#: py/compile.c
msgid "'async for' or 'async with' outside async function"
msgstr ""
#: py/compile.c
msgid "'await' outside function"
msgstr "'await' fuera de la función"
@ -907,10 +911,13 @@ msgstr "Pin inválido para canal derecho"
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c
#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c
#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins"
msgstr "pines inválidos"
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins for PWMOut"
msgstr ""
#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c
msgid "Invalid polarity"
msgstr "Polaridad inválida"
@ -1000,6 +1007,10 @@ msgstr "Debe de ser una subclase de %q"
msgid "Must provide MISO or MOSI pin"
msgstr ""
#: py/parse.c
msgid "Name too long"
msgstr ""
#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "Negative step not supported"
msgstr ""
@ -1183,7 +1194,7 @@ msgid "PulseIn not yet supported"
msgstr ""
#: ports/stm32f4/common-hal/pulseio/PulseOut.c
msgid "PulseOut not yet supported"
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm32f4/common-hal/os/__init__.c
@ -2223,7 +2234,7 @@ msgstr ""
msgid "inline assembler must be a function"
msgstr "ensamblador en línea debe ser una función"
#: extmod/ulab/code/linalg.c
#: extmod/ulab/code/create.c
msgid "input argument must be an integer or a 2-tuple"
msgstr ""
@ -2552,7 +2563,7 @@ msgstr "no suficientes argumentos para format string"
msgid "number of arguments must be 2, or 3"
msgstr ""
#: extmod/ulab/code/numerical.c
#: extmod/ulab/code/create.c
msgid "number of points must be at least 2"
msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-27 11:02-0600\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2018-12-20 22:15-0800\n"
"Last-Translator: Timothy <me@timothygarcia.ca>\n"
"Language-Team: fil\n"
@ -186,6 +186,10 @@ msgstr "Ang 'S' at 'O' ay hindi suportadong uri ng format"
msgid "'align' requires 1 argument"
msgstr "'align' kailangan ng 1 argument"
#: py/compile.c
msgid "'async for' or 'async with' outside async function"
msgstr ""
#: py/compile.c
msgid "'await' outside function"
msgstr "'await' sa labas ng function"
@ -915,10 +919,13 @@ msgstr "Mali ang pin para sa kanang channel"
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c
#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c
#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins"
msgstr "Mali ang pins"
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins for PWMOut"
msgstr ""
#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c
msgid "Invalid polarity"
msgstr "Mali ang polarity"
@ -1008,6 +1015,10 @@ msgstr ""
msgid "Must provide MISO or MOSI pin"
msgstr ""
#: py/parse.c
msgid "Name too long"
msgstr ""
#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "Negative step not supported"
msgstr ""
@ -1189,7 +1200,7 @@ msgid "PulseIn not yet supported"
msgstr ""
#: ports/stm32f4/common-hal/pulseio/PulseOut.c
msgid "PulseOut not yet supported"
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm32f4/common-hal/os/__init__.c
@ -2238,7 +2249,7 @@ msgstr ""
msgid "inline assembler must be a function"
msgstr "inline assembler ay dapat na function"
#: extmod/ulab/code/linalg.c
#: extmod/ulab/code/create.c
msgid "input argument must be an integer or a 2-tuple"
msgstr ""
@ -2565,7 +2576,7 @@ msgstr "kulang sa arguments para sa format string"
msgid "number of arguments must be 2, or 3"
msgstr ""
#: extmod/ulab/code/numerical.c
#: extmod/ulab/code/create.c
msgid "number of points must be at least 2"
msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-27 11:02-0600\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2019-04-14 20:05+0100\n"
"Last-Translator: Pierrick Couturier <arofarn@arofarn.info>\n"
"Language-Team: fr\n"
@ -187,6 +187,10 @@ msgstr "'S' et 'O' ne sont pas des types de format supportés"
msgid "'align' requires 1 argument"
msgstr "'align' nécessite 1 argument"
#: py/compile.c
msgid "'async for' or 'async with' outside async function"
msgstr ""
#: py/compile.c
msgid "'await' outside function"
msgstr "'await' en dehors d'une fonction"
@ -921,10 +925,13 @@ msgstr "Broche invalide pour le canal droit"
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c
#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c
#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins"
msgstr "Broches invalides"
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins for PWMOut"
msgstr ""
#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c
msgid "Invalid polarity"
msgstr "Polarité invalide"
@ -1015,6 +1022,10 @@ msgstr ""
msgid "Must provide MISO or MOSI pin"
msgstr ""
#: py/parse.c
msgid "Name too long"
msgstr ""
#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "Negative step not supported"
msgstr ""
@ -1202,7 +1213,7 @@ msgid "PulseIn not yet supported"
msgstr ""
#: ports/stm32f4/common-hal/pulseio/PulseOut.c
msgid "PulseOut not yet supported"
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm32f4/common-hal/os/__init__.c
@ -2262,7 +2273,7 @@ msgstr ""
msgid "inline assembler must be a function"
msgstr "l'assembleur doit être une fonction"
#: extmod/ulab/code/linalg.c
#: extmod/ulab/code/create.c
msgid "input argument must be an integer or a 2-tuple"
msgstr ""
@ -2592,7 +2603,7 @@ msgstr "pas assez d'arguments pour la chaîne de format"
msgid "number of arguments must be 2, or 3"
msgstr ""
#: extmod/ulab/code/numerical.c
#: extmod/ulab/code/create.c
msgid "number of points must be at least 2"
msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-27 11:02-0600\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2018-10-02 16:27+0200\n"
"Last-Translator: Enrico Paganin <enrico.paganin@mail.com>\n"
"Language-Team: \n"
@ -185,6 +185,10 @@ msgstr "'S' e 'O' non sono formati supportati"
msgid "'align' requires 1 argument"
msgstr "'align' richiede 1 argomento"
#: py/compile.c
msgid "'async for' or 'async with' outside async function"
msgstr ""
#: py/compile.c
msgid "'await' outside function"
msgstr "'await' al di fuori della funzione"
@ -917,10 +921,13 @@ msgstr "Pin non valido per il canale destro"
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c
#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c
#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins"
msgstr "Pin non validi"
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins for PWMOut"
msgstr ""
#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c
msgid "Invalid polarity"
msgstr "Polarità non valida"
@ -1012,6 +1019,10 @@ msgstr ""
msgid "Must provide MISO or MOSI pin"
msgstr ""
#: py/parse.c
msgid "Name too long"
msgstr ""
#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "Negative step not supported"
msgstr ""
@ -1198,7 +1209,7 @@ msgid "PulseIn not yet supported"
msgstr ""
#: ports/stm32f4/common-hal/pulseio/PulseOut.c
msgid "PulseOut not yet supported"
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm32f4/common-hal/os/__init__.c
@ -2239,7 +2250,7 @@ msgstr ""
msgid "inline assembler must be a function"
msgstr "inline assembler deve essere una funzione"
#: extmod/ulab/code/linalg.c
#: extmod/ulab/code/create.c
msgid "input argument must be an integer or a 2-tuple"
msgstr ""
@ -2570,7 +2581,7 @@ msgstr "argomenti non sufficienti per la stringa di formattazione"
msgid "number of arguments must be 2, or 3"
msgstr ""
#: extmod/ulab/code/numerical.c
#: extmod/ulab/code/create.c
msgid "number of points must be at least 2"
msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-27 11:02-0600\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2019-05-06 14:22-0700\n"
"Last-Translator: \n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -185,6 +185,10 @@ msgstr ""
msgid "'align' requires 1 argument"
msgstr "'align' 에는 1 개의 독립변수가 필요합니다"
#: py/compile.c
msgid "'async for' or 'async with' outside async function"
msgstr ""
#: py/compile.c
msgid "'await' outside function"
msgstr "'await' 는 펑크션 외부에 있습니다"
@ -903,10 +907,13 @@ msgstr "오른쪽 채널 핀이 잘못되었습니다"
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c
#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c
#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins"
msgstr "핀이 유효하지 않습니다"
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins for PWMOut"
msgstr ""
#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c
msgid "Invalid polarity"
msgstr ""
@ -996,6 +1003,10 @@ msgstr ""
msgid "Must provide MISO or MOSI pin"
msgstr ""
#: py/parse.c
msgid "Name too long"
msgstr ""
#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "Negative step not supported"
msgstr ""
@ -1171,7 +1182,7 @@ msgid "PulseIn not yet supported"
msgstr ""
#: ports/stm32f4/common-hal/pulseio/PulseOut.c
msgid "PulseOut not yet supported"
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm32f4/common-hal/os/__init__.c
@ -2197,7 +2208,7 @@ msgstr ""
msgid "inline assembler must be a function"
msgstr ""
#: extmod/ulab/code/linalg.c
#: extmod/ulab/code/create.c
msgid "input argument must be an integer or a 2-tuple"
msgstr ""
@ -2520,7 +2531,7 @@ msgstr ""
msgid "number of arguments must be 2, or 3"
msgstr ""
#: extmod/ulab/code/numerical.c
#: extmod/ulab/code/create.c
msgid "number of points must be at least 2"
msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-27 11:02-0600\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2019-03-19 18:37-0700\n"
"Last-Translator: Radomir Dopieralski <circuitpython@sheep.art.pl>\n"
"Language-Team: pl\n"
@ -184,6 +184,10 @@ msgstr "typy formatowania 'S' oraz 'O' są niewspierane"
msgid "'align' requires 1 argument"
msgstr "'align' wymaga 1 argumentu"
#: py/compile.c
msgid "'async for' or 'async with' outside async function"
msgstr ""
#: py/compile.c
msgid "'await' outside function"
msgstr "'await' poza funkcją"
@ -904,10 +908,13 @@ msgstr "Zła nóżka dla prawego kanału"
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c
#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c
#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins"
msgstr "Złe nóżki"
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins for PWMOut"
msgstr ""
#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c
msgid "Invalid polarity"
msgstr "Zła polaryzacja"
@ -997,6 +1004,10 @@ msgstr ""
msgid "Must provide MISO or MOSI pin"
msgstr ""
#: py/parse.c
msgid "Name too long"
msgstr ""
#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "Negative step not supported"
msgstr ""
@ -1172,7 +1183,7 @@ msgid "PulseIn not yet supported"
msgstr ""
#: ports/stm32f4/common-hal/pulseio/PulseOut.c
msgid "PulseOut not yet supported"
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm32f4/common-hal/os/__init__.c
@ -2201,7 +2212,7 @@ msgstr ""
msgid "inline assembler must be a function"
msgstr "wtrącony asembler musi być funkcją"
#: extmod/ulab/code/linalg.c
#: extmod/ulab/code/create.c
msgid "input argument must be an integer or a 2-tuple"
msgstr ""
@ -2524,7 +2535,7 @@ msgstr "nie dość argumentów przy formatowaniu"
msgid "number of arguments must be 2, or 3"
msgstr ""
#: extmod/ulab/code/numerical.c
#: extmod/ulab/code/create.c
msgid "number of points must be at least 2"
msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-27 11:02-0600\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2018-10-02 21:14-0000\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -185,6 +185,10 @@ msgstr "'S' e 'O' não são tipos de formato suportados"
msgid "'align' requires 1 argument"
msgstr ""
#: py/compile.c
msgid "'async for' or 'async with' outside async function"
msgstr ""
#: py/compile.c
msgid "'await' outside function"
msgstr ""
@ -910,10 +914,13 @@ msgstr "Pino inválido para canal direito"
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c
#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c
#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins"
msgstr "Pinos inválidos"
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins for PWMOut"
msgstr ""
#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c
msgid "Invalid polarity"
msgstr ""
@ -1004,6 +1011,10 @@ msgstr ""
msgid "Must provide MISO or MOSI pin"
msgstr ""
#: py/parse.c
msgid "Name too long"
msgstr ""
#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "Negative step not supported"
msgstr ""
@ -1183,7 +1194,7 @@ msgid "PulseIn not yet supported"
msgstr ""
#: ports/stm32f4/common-hal/pulseio/PulseOut.c
msgid "PulseOut not yet supported"
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm32f4/common-hal/os/__init__.c
@ -2214,7 +2225,7 @@ msgstr ""
msgid "inline assembler must be a function"
msgstr ""
#: extmod/ulab/code/linalg.c
#: extmod/ulab/code/create.c
msgid "input argument must be an integer or a 2-tuple"
msgstr ""
@ -2537,7 +2548,7 @@ msgstr ""
msgid "number of arguments must be 2, or 3"
msgstr ""
#: extmod/ulab/code/numerical.c
#: extmod/ulab/code/create.c
msgid "number of points must be at least 2"
msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: circuitpython-cn\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-27 11:02-0600\n"
"POT-Creation-Date: 2020-03-03 20:13-0600\n"
"PO-Revision-Date: 2019-04-13 10:10-0700\n"
"Last-Translator: hexthat\n"
"Language-Team: Chinese Hanyu Pinyin\n"
@ -190,6 +190,10 @@ msgstr "'S' hé 'O' bù zhīchí géshì lèixíng"
msgid "'align' requires 1 argument"
msgstr "'align' xūyào 1 gè cānshù"
#: py/compile.c
msgid "'async for' or 'async with' outside async function"
msgstr ""
#: py/compile.c
msgid "'await' outside function"
msgstr "'await' wàibù gōngnéng"
@ -912,10 +916,13 @@ msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào"
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c
#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c
#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins"
msgstr "Wúxiào de yǐn jiǎo"
#: ports/stm32f4/common-hal/pulseio/PWMOut.c
msgid "Invalid pins for PWMOut"
msgstr ""
#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c
msgid "Invalid polarity"
msgstr "Wúxiào liǎng jí zhí"
@ -1005,6 +1012,10 @@ msgstr "Bìxū shì %q zi lèi."
msgid "Must provide MISO or MOSI pin"
msgstr "Bìxū tígōng MISO huò MOSI yǐn jiǎo"
#: py/parse.c
msgid "Name too long"
msgstr ""
#: shared-bindings/_pixelbuf/PixelBuf.c
msgid "Negative step not supported"
msgstr "Bù zhīchí fù bù"
@ -1186,8 +1197,8 @@ msgid "PulseIn not yet supported"
msgstr "Shàng bù zhīchí PulseIn"
#: ports/stm32f4/common-hal/pulseio/PulseOut.c
msgid "PulseOut not yet supported"
msgstr "Shàng bù zhīchí PulseOut"
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm32f4/common-hal/os/__init__.c
msgid "RNG DeInit Error"
@ -2229,7 +2240,7 @@ msgstr ""
msgid "inline assembler must be a function"
msgstr "nèi lián jíhé bìxū shì yīgè hánshù"
#: extmod/ulab/code/linalg.c
#: extmod/ulab/code/create.c
msgid "input argument must be an integer or a 2-tuple"
msgstr ""
@ -2554,7 +2565,7 @@ msgstr "géshì zìfú chuàn cān shǔ bùzú"
msgid "number of arguments must be 2, or 3"
msgstr ""
#: extmod/ulab/code/numerical.c
#: extmod/ulab/code/create.c
msgid "number of points must be at least 2"
msgstr ""
@ -3286,6 +3297,9 @@ msgstr "líng bù"
#~ msgid "Pixel beyond bounds of buffer"
#~ msgstr "Xiàngsù chāochū huǎnchōng qū biānjiè"
#~ msgid "PulseOut not yet supported"
#~ msgstr "Shàng bù zhīchí PulseOut"
#~ msgid "Range out of bounds"
#~ msgstr "Fànwéi chāochū biānjiè"

View File

@ -3,4 +3,5 @@
/mpy-cross.static
/mpy-cross.static.exe
/mpy-cross.static-raspbian
/mpy-cross.fuzz
/pitools

6
mpy-cross/Makefile.fuzz Normal file
View File

@ -0,0 +1,6 @@
PROG=mpy-cross.fuzz
BUILD=build-static
STATIC_BUILD=1
CC=afl-clang-fast
include mpy-cross.mk

View File

@ -102,7 +102,6 @@ CFLAGS += -Wno-undef
CFLAGS += -Wno-cast-align
NRF_DEFINES += -DCONFIG_GPIO_AS_PINRESET
NRF_DEFINES += -D_FS_DISK_READ_ALIGNED=1
CFLAGS += $(NRF_DEFINES)
CFLAGS += \

View File

@ -83,11 +83,52 @@ bool spi_flash_sector_command(uint8_t command, uint32_t address) {
}
bool spi_flash_write_data(uint32_t address, uint8_t* data, uint32_t length) {
// TODO: In theory, this also needs to handle unaligned data and
// non-multiple-of-4 length. (in practice, I don't think the fat layer
// generates such writes)
return nrfx_qspi_write(data, length, address) == NRFX_SUCCESS;
}
bool spi_flash_read_data(uint32_t address, uint8_t* data, uint32_t length) {
return nrfx_qspi_read(data, length, address) == NRFX_SUCCESS;
int misaligned = ((intptr_t)data) & 3;
// If the data is misaligned, we need to read 4 bytes
// into an aligned buffer, and then copy 1, 2, or 3 bytes from the aligned
// buffer to data.
if(misaligned) {
int sz = 4 - misaligned;
__attribute__((aligned(4))) uint8_t buf[4];
if(nrfx_qspi_read(buf, 4, address) != NRFX_SUCCESS) {
return false;
}
memcpy(data, buf, sz);
data += sz;
address += sz;
length -= sz;
}
// nrfx_qspi_read works in 4 byte increments, though it doesn't
// signal an error if sz is not a multiple of 4. Read (directly into data)
// all but the last 1, 2, or 3 bytes depending on the (remaining) length.
uint32_t sz = length & ~(uint32_t)3;
if(nrfx_qspi_read(data, sz, address) != NRFX_SUCCESS) {
return false;
}
data += sz;
address += sz;
length -= sz;
// Now, if we have any bytes left over, we must do a final read of 4
// bytes and copy 1, 2, or 3 bytes to data.
if(length) {
__attribute__((aligned(4))) uint8_t buf[4];
if(nrfx_qspi_read(buf, 4, address) != NRFX_SUCCESS) {
return false;
}
memcpy(data, buf, length);
}
return true;
}
void spi_flash_init(void) {

View File

@ -163,7 +163,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
} else if (var_freq_mismatch) {
mp_raise_ValueError(translate("Cannot vary frequency on a timer that is already in use"));
} else {
mp_raise_ValueError(translate("Invalid pins"));
mp_raise_ValueError(translate("Invalid pins for PWMOut"));
}
}

View File

@ -35,21 +35,180 @@
#include "shared-bindings/pulseio/PWMOut.h"
#include "supervisor/shared/translate.h"
#include "stm32f4xx_hal.h"
#include "common-hal/microcontroller/Pin.h"
#include "tick.h"
// A single timer is shared amongst all PulseOut objects under the assumption that
// the code is single threaded.
STATIC uint8_t refcount = 0;
STATIC uint16_t *pulse_array = NULL;
STATIC volatile uint16_t pulse_array_index = 0;
STATIC uint16_t pulse_array_length;
//Timer is shared, must be accessible by interrupt
STATIC TIM_HandleTypeDef t7_handle;
pulseio_pulseout_obj_t *curr_pulseout = NULL;
STATIC void turn_on(pulseio_pulseout_obj_t *pulseout) {
// Turn on PWM
HAL_TIM_PWM_Start(&(pulseout->pwmout->handle), pulseout->pwmout->channel);
}
STATIC void turn_off(pulseio_pulseout_obj_t *pulseout) {
// Turn off PWM
HAL_TIM_PWM_Stop(&(pulseout->pwmout->handle), pulseout->pwmout->channel);
// Make sure pin is low.
HAL_GPIO_WritePin(pin_port(pulseout->pwmout->tim->pin->port),
pin_mask(pulseout->pwmout->tim->pin->number), 0);
}
STATIC void start_timer(void) {
// Set the new period
t7_handle.Init.Period = pulse_array[pulse_array_index] - 1;
HAL_TIM_Base_Init(&t7_handle);
// TIM7 has limited HAL support, set registers manually
t7_handle.Instance->SR = 0; // Prevent the SR from triggering an interrupt
t7_handle.Instance->CR1 |= TIM_CR1_CEN; // Resume timer
t7_handle.Instance->CR1 |= TIM_CR1_URS; // Disable non-overflow interrupts
__HAL_TIM_ENABLE_IT(&t7_handle, TIM_IT_UPDATE);
}
STATIC void pulseout_event_handler(void) {
if (curr_pulseout->pwmout == NULL) {
return; //invalid interrupt
}
HAL_GPIO_WritePin(pin_port(2),pin_mask(6), 1);
HAL_GPIO_WritePin(pin_port(2),pin_mask(6), 0);
pulse_array_index++;
// No more pulses. Turn off output and don't restart.
if (pulse_array_index >= pulse_array_length) {
turn_off(curr_pulseout);
return;
}
// Alternate on and off, starting with on.
if (pulse_array_index % 2 == 0) {
turn_on(curr_pulseout);
} else {
turn_off(curr_pulseout);
}
// Count up to the next given value.
start_timer();
}
void pulseout_reset() {
#if HAS_BASIC_TIM
__HAL_RCC_TIM7_CLK_DISABLE();
refcount = 0;
#endif
}
void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self,
const pulseio_pwmout_obj_t* carrier) {
mp_raise_NotImplementedError(translate("PulseOut not yet supported"));
#if !(HAS_BASIC_TIM)
mp_raise_NotImplementedError(translate("PulseOut not supported on this chip"));
#else
// Add to active PulseOuts
refcount++;
// Calculate a 1 ms period
uint32_t source, clk_div;
source = HAL_RCC_GetPCLK1Freq(); // TIM7 is on APB1
clk_div = RCC->CFGR & RCC_CFGR_PPRE1;
// APB quirk, see See DM00031020 Rev 4, page 115.
if (clk_div != 0) {
// APB prescaler for this timer is > 1
source *= 2;
}
uint32_t prescaler = source/1000000; //1us intervals
__HAL_RCC_TIM7_CLK_ENABLE();
HAL_NVIC_SetPriority(TIM7_IRQn, 4, 0);
HAL_NVIC_EnableIRQ(TIM7_IRQn);
// Timers 6 and 7 have no pins, so using them doesn't affect PWM availability
t7_handle.Instance = TIM7;
t7_handle.Init.Period = 100; //immediately replaced.
t7_handle.Init.Prescaler = prescaler - 1;
t7_handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
t7_handle.Init.CounterMode = TIM_COUNTERMODE_UP;
t7_handle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
HAL_TIM_Base_Init(&t7_handle);
t7_handle.Instance->SR = 0;
// The HAL can't work with const, recast required.
self->pwmout = (pulseio_pwmout_obj_t*)carrier;
turn_off(self);
#endif
}
bool common_hal_pulseio_pulseout_deinited(pulseio_pulseout_obj_t* self) {
return true;
return self->pwmout == NULL;
}
void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t* self) {
if (common_hal_pulseio_pulseout_deinited(self)) {
return;
}
turn_on(self);
self->pwmout = NULL;
refcount--;
if (refcount == 0) {
#if HAS_BASIC_TIM
__HAL_RCC_TIM7_CLK_DISABLE();
#endif
}
}
void common_hal_pulseio_pulseout_send(pulseio_pulseout_obj_t* self, uint16_t* pulses, uint16_t length) {
pulse_array = pulses;
pulse_array_index = 0;
pulse_array_length = length;
curr_pulseout = self;
turn_on(self);
// Count up to the next given value.
start_timer();
// Use when debugging, or issues are irrecoverable
// uint32_t starttime = supervisor_ticks_ms64();
// uint32_t timeout = 10000;
while(pulse_array_index < length) {
// Do other things while we wait. The interrupts will handle sending the
// signal.
RUN_BACKGROUND_TASKS;
// Use when debugging, or issues are irrecoverable
// if ((supervisor_ticks_ms64() - starttime ) > timeout ) {
// mp_raise_RuntimeError(translate("Error: Send Timeout"));
// }
}
//turn off timer counter.
t7_handle.Instance->CR1 &= ~TIM_CR1_CEN;
}
void TIM7_IRQHandler(void)
{
// Detect TIM Update event
if (__HAL_TIM_GET_FLAG(&t7_handle, TIM_FLAG_UPDATE) != RESET)
{
if (__HAL_TIM_GET_IT_SOURCE(&t7_handle, TIM_IT_UPDATE) != RESET)
{
__HAL_TIM_CLEAR_IT(&t7_handle, TIM_IT_UPDATE);
pulseout_event_handler();
}
}
}

View File

@ -34,7 +34,7 @@
typedef struct {
mp_obj_base_t base;
const pulseio_pwmout_obj_t *pwmout;
pulseio_pwmout_obj_t *pwmout;
} pulseio_pulseout_obj_t;
void pulseout_reset(void);

View File

@ -138,23 +138,26 @@ typedef struct {
.pin = tim_pin, \
}
//Starter Lines
//Access Lines
#ifdef STM32F401xE
#define HAS_DAC 0
#define HAS_TRNG 0
#define HAS_BASIC_TIM 0
#include "stm32f401xe/periph.h"
#endif
#ifdef STM32F411xE
#define HAS_DAC 0
#define HAS_TRNG 0
#define HAS_BASIC_TIM 0
#include "stm32f411xe/periph.h"
#endif
#ifdef STM32F412Zx
#define HAS_DAC 0
#define HAS_TRNG 1
#define HAS_BASIC_TIM 1
#include "stm32f412zx/periph.h"
#endif
@ -163,12 +166,14 @@ typedef struct {
#ifdef STM32F405xx
#define HAS_DAC 1
#define HAS_TRNG 1
#define HAS_BASIC_TIM 1
#include "stm32f405xx/periph.h"
#endif
#ifdef STM32F407xx
#define HAS_DAC 1
#define HAS_TRNG 1
#define HAS_BASIC_TIM 1
#include "stm32f407xx/periph.h"
#endif

View File

@ -35,6 +35,7 @@
#include "common-hal/busio/SPI.h"
#include "common-hal/busio/UART.h"
#include "common-hal/pulseio/PWMOut.h"
#include "common-hal/pulseio/PulseOut.h"
#include "stm32f4/clocks.h"
#include "stm32f4/gpio.h"
@ -60,6 +61,7 @@ void reset_port(void) {
spi_reset();
uart_reset();
pwmout_reset();
pulseout_reset();
}
void reset_to_bootloader(void) {

View File

@ -277,6 +277,18 @@ coverage_test: coverage
coverage_clean:
$(MAKE) V=2 BUILD=build-coverage PROG=micropython_coverage clean
# build an interpreter for fuzzing
fuzz:
$(MAKE) \
CC=afl-clang-fast DEBUG=1 \
CFLAGS_EXTRA='$(CFLAGS_EXTRA) -ffunction-sections' \
LDFLAGS_EXTRA='$(LDFLAGS_EXTRA)' \
BUILD=build-fuzz PROG=micropython_fuzz
fuzz_clean:
$(MAKE) V=2 BUILD=build-fuzz PROG=micropython_fuzz clean
# Value of configure's --host= option (required for cross-compilation).
# Deduce it from CROSS_COMPILE by default, but can be overridden.
ifneq ($(CROSS_COMPILE),)

View File

@ -1711,6 +1711,16 @@ STATIC void compile_yield_from(compiler_t *comp) {
}
#if MICROPY_PY_ASYNC_AWAIT
STATIC bool compile_require_async_context(compiler_t *comp, mp_parse_node_struct_t *pns) {
int scope_flags = comp->scope_cur->scope_flags;
if(scope_flags & MP_SCOPE_FLAG_GENERATOR) {
return true;
}
compile_syntax_error(comp, (mp_parse_node_t)pns,
translate("'async for' or 'async with' outside async function"));
return false;
}
STATIC void compile_await_object_method(compiler_t *comp, qstr method) {
EMIT_ARG(load_method, method, false);
EMIT_ARG(call_method, 0, 0, 0);
@ -1720,6 +1730,10 @@ STATIC void compile_await_object_method(compiler_t *comp, qstr method) {
STATIC void compile_async_for_stmt(compiler_t *comp, mp_parse_node_struct_t *pns) {
// comp->break_label |= MP_EMIT_BREAK_FROM_FOR;
if(!compile_require_async_context(comp, pns)) {
return;
}
qstr context = MP_PARSE_NODE_LEAF_ARG(pns->nodes[1]);
uint while_else_label = comp_next_label(comp);
uint try_exception_label = comp_next_label(comp);
@ -1857,6 +1871,9 @@ STATIC void compile_async_with_stmt_helper(compiler_t *comp, int n, mp_parse_nod
}
STATIC void compile_async_with_stmt(compiler_t *comp, mp_parse_node_struct_t *pns) {
if(!compile_require_async_context(comp, pns)) {
return;
}
// get the nodes for the pre-bit of the with (the a as b, c as d, ... bit)
mp_parse_node_t *nodes;
int n = mp_parse_node_extract_list(&pns->nodes[0], PN_with_stmt_list, &nodes);

View File

@ -477,6 +477,9 @@ STATIC void push_result_token(parser_t *parser, uint8_t rule_id) {
mp_parse_node_t pn;
mp_lexer_t *lex = parser->lexer;
if (lex->tok_kind == MP_TOKEN_NAME) {
if(lex->vstr.len >= (1 << (8 * MICROPY_QSTR_BYTES_IN_LEN))) {
mp_raise_msg(&mp_type_SyntaxError, translate("Name too long"));
}
qstr id = qstr_from_strn(lex->vstr.buf, lex->vstr.len);
#if MICROPY_COMP_CONST
// if name is a standalone identifier, look it up in the table of dynamic constants

View File

@ -21,6 +21,10 @@ HEX = ('hex',)
HEX_UF2 = ('hex', 'uf2')
SPK = ('spk',)
# Example:
# https://downloads.circuitpython.org/bin/trinket_m0/en_US/adafruit-circuitpython-trinket_m0-en_US-5.0.0-rc.0.uf2
DOWNLOAD_BASE_URL = "https://downloads.circuitpython.org/bin"
# Default extensions
extension_by_port = {
"nrf": UF2,
@ -33,8 +37,10 @@ extension_by_port = {
# Per board overrides
extension_by_board = {
# samd
"arduino_mkr1300": BIN,
"arduino_zero": BIN,
"arduino_mkr1300": BIN_UF2,
"arduino_mkrzero": BIN_UF2,
"arduino_nano_33_iot": BIN_UF2,
"arduino_zero": BIN_UF2,
"feather_m0_adalogger": BIN_UF2,
"feather_m0_basic": BIN_UF2,
"feather_m0_rfm69": BIN_UF2,
@ -275,7 +281,14 @@ def generate_download_info():
files = []
new_version["files"][language] = files
for extension in board_info["extensions"]:
files.append("https://github.com/adafruit/circuitpython/releases/download/{tag}/adafruit-circuitpython-{alias}-{language}-{tag}.{extension}".format(tag=new_tag, alias=alias, language=language, extension=extension))
files.append(
"{base_url}/{alias}/{language}/adafruit-circuitpython-{alias}-{language}-{tag}.{extension}"
.format(
base_url=DOWNLOAD_BASE_URL,
tag=new_tag,
alias=alias,
language=language,
extension=extension))
current_info[alias]["downloads"] = alias_info["download_count"]
current_info[alias]["versions"].append(new_version)

View File

@ -1,35 +0,0 @@
#! /usr/bin/env python3
import os
import os.path
import sys
import uritemplate
sys.path.append("adabot")
import adabot.github_requests as github
exit_status = 0
for dirpath, dirnames, filenames in os.walk("../bin"):
if not filenames:
continue
for filename in filenames:
full_filename = os.path.join(dirpath, filename)
label = filename.replace("adafruit-circuitpython-", "")
url_vars = {}
url_vars["name"] = filename
url_vars["label"] = label
url = uritemplate.expand(os.environ["UPLOAD_URL"], url_vars)
headers = {"content-type": "application/octet-stream"}
print(url)
with open(full_filename, "rb") as f:
response = github.post(url, data=f, headers=headers)
if not response.ok:
if response.status_code == 422 and response.json().get("errors", [{"code":""}])[0]["code"] == "already_exists":
print("File already uploaded. Skipping.")
continue
print("Upload of {} failed with {}.".format(filename, response.status_code))
print(response.text)
sys.exit(response.status_code)
sys.exit(exit_status)