Commit Graph

14675 Commits

Author SHA1 Message Date
Scott Shawcroft e63796c7bc
Special exception message for when pairing prompt is ignored. 2019-11-21 16:32:42 -08:00
Scott Shawcroft 39f4046f70
Fix pairing when peripheral. Central untested. 2019-11-21 16:32:42 -08:00
Hierophect 5b907aa076 change order 2019-11-21 18:24:10 -05:00
Hierophect b3ad823b4c yaml additions 2019-11-21 17:39:14 -05:00
Hierophect b5ff9684bb remove misplaced status LED definitions 2019-11-21 17:09:28 -05:00
Hierophect 4e4ecafd97 Add definitions for PYB Nano and blackpill 2019-11-21 16:53:06 -05:00
Dan Halbert 2adecda5eb
Merge pull request #2311 from tannewt/redo_bleio_errors
Use BluetoothError in _bleio
2019-11-21 16:44:26 -05:00
Dan Halbert e06dc72359
Merge pull request #2307 from hierophect/stm32-spi-cleanup
STM32: SPI clock rate fix and cleanup
2019-11-21 16:12:06 -05:00
Scott Shawcroft 98e55eb577
Only add module when printing exception. 2019-11-21 12:26:25 -08:00
Hierophect a96317d566 requested style changes 2019-11-21 14:30:07 -05:00
Hierophect 13d786b2ef added pin defs 2019-11-21 14:27:59 -05:00
Scott Shawcroft 521c7531bc
Improve printing to include _bleio. prefix for type. 2019-11-21 11:04:17 -08:00
Scott Shawcroft 5e857fdb67
Use BluetoothError in _bleio
This better differentiates errors than using OSError everywhere.
2019-11-20 14:02:15 -08:00
Scott Shawcroft 372f22c0b3
Merge pull request #1858 from rafa-gould/korean_trans
Created Korean Translations
2019-11-20 13:22:26 -08:00
Hierophect 006182f4e8 Remove meowbit for now 2019-11-20 15:56:00 -05:00
Jeff Epler 46c5775ba4 supervisor: tick: add supervisor_fake_tick 2019-11-20 14:37:13 -06:00
Jeff Epler a9baa0f954 supervisor: tick: document 2019-11-20 14:37:13 -06:00
Jeff Epler 70719597ab supervisor: tick: Rewrite without atomics 2019-11-20 14:37:13 -06:00
Hierophect cf4a3237e7 Merge remote-tracking branch 'upstream/master' into stm32-meowbit-etc 2019-11-20 15:31:55 -05:00
Hierophect 9764006f81 add F401 pin definition 2019-11-20 15:30:31 -05:00
Hierophect 3d1b6d9fc8 fix typo 2019-11-20 12:07:12 -05:00
Hierophect bd9893ab98 clean up SPI module readability 2019-11-20 12:00:45 -05:00
Hierophect 0b558e8714 fix error in SPI busclock selection 2019-11-20 11:34:49 -05:00
Jeff Epler eae201a6dd
Merge pull request #2305 from cbyr2401/master
removed Robo HAT MM1 M0 board.
2019-11-20 10:02:53 -06:00
cbyr2401 eb39fcc947
Merge pull request #1 from wallarug/patch-1
Removed robohatmm1_m0 from build.
2019-11-21 01:13:58 +11:00
wallarug 8d72233afd
Removed robohatmm1_m0 from build. 2019-11-21 01:12:48 +11:00
wallarug fce7b89087 removed Robo HAT MM1 M0 board. 2019-11-20 21:34:24 +11:00
Melissa LeBlanc-Williams 41fb6e7824
Merge pull request #2303 from makermelissa/master
Removing submodule that was accidentally stowed away in PR 2302
2019-11-19 17:06:17 -08:00
Melissa LeBlanc-Williams d763559120 Removing submodule that was accidentally stowed away in PR 2302 2019-11-19 16:17:30 -08:00
Melissa LeBlanc-Williams fde9dd539d
Merge pull request #2302 from makermelissa/master
Added Edgebadge alias build for Pybadge
2019-11-19 15:37:57 -08:00
Melissa LeBlanc-Williams fe6ec9a7d4 Added Edgebadge alias for Pybadge 2019-11-19 14:53:58 -08:00
Scott Shawcroft 11c2c3443f
Add support for extended (>31 byte) BLE advertisements. 2019-11-19 13:55:58 -08:00
Dan Halbert 1a22d8a0f2
Merge pull request #2291 from hierophect/stm32-neopixel
STM32: Neopixel support
2019-11-18 23:45:09 -05:00
Dan Halbert 41aa214589
Merge pull request #2300 from hierophect/stm32-urandom
STM32: implement OS urandom
2019-11-18 22:32:14 -05:00
Hierophect 4a25c2344e implement os urandom 2019-11-18 18:27:25 -05:00
Hierophect 256abf5505 Add board folders 2019-11-18 16:13:27 -05:00
Ayan Pahwa a0ef667a14 Supervisor: create code.py file with sample code 2019-11-19 01:59:29 +05:30
Hierophect a4797327cd add microcontroller toggles for status LED 2019-11-18 13:51:59 -05:00
Dan Halbert 2da1b68956
Merge pull request #2296 from jepler/github-actions-forks
workflows: Don't try to upload when running in someone's fork
2019-11-18 13:49:24 -05:00
Jeff Epler 568636d562 run_background_tasks: Do nothing unless there has been a tick
This improves performance of running python code by 34%, based
on the "pystone" benchmark on metro m4 express at 5000 passes
(1127.65 -> 1521.6 passes/second).

In addition, by instrumenting the tick function and monitoring on an
oscilloscope, the time actually spent in run_background_tasks() on
the metro m4 decreases from average 43% to 0.5%. (however, there's
some additional overhead that is moved around and not accounted for
in that "0.5%" figure, each time supervisor_run_background_tasks_if_tick
is called but no tick has occurred)

On the CPB, it increases pystone from 633 to 769, a smaller percentage
increase of 21%.  I did not measure the time actually spent in
run_background_tasks() on CPB.

Testing performed: on metro m4 and cpb, run pystone adapted from python3.4
(change time.time to time.monotonic for sub-second resolution)

Besides running a 5000 pass test, I also ran a 50-pass test while
scoping how long an output pin was set.  Average: 34.59ms or 1445/s on m4,
67.61ms or 739/s on cbp, both matching the other pystone result reasonably
well.

import pystone
import board
import digitalio
import time

d = digitalio.DigitalInOut(board.D13)
d.direction = digitalio.Direction.OUTPUT

while True:
    d.value = 0
    time.sleep(.01)
    d.value = 1
    pystone.main(50)
2019-11-18 11:26:48 -06:00
Jeff Epler 40a47d41df samd: background: Allow monitoring time taken in background task
If you define MONITOR_BACKGROUND_TASK, then a physical output pin
(Metro M4 Express's "SCL" pin by default) will be set HIGH while in
the background task and LOW at other times
2019-11-18 11:01:24 -06:00
Jeff Epler 7f744a2369 Supervisor: move most of systick to the supervisor
This code is shared by most parts, except where not all the #ifdefs
inside the tick function were present in all ports.  This mostly would
have broken gamepad tick support on non-samd ports.

The "ms32" and "ms64" variants of the tick functions are introduced
because there is no 64-bit atomic read.  Disabling interrupts avoids
a low probability bug where milliseconds could be off by ~49.5 days
once every ~49.5 days (2^32 ms).

Avoiding disabling interrupts when only the low 32 bits are needed is a minor
optimization.

Testing performed: on metro m4 express, USB still works and
time.monotonic_ns() still counts up
2019-11-18 11:01:23 -06:00
Jeff Epler 45d1b290ee circuitpy_mpconfig.h: Express HOOKS in terms of RUN_BACKGROUND_TASKS
.. this means that when we want to modify RUN_BACKGROUND_TASKS, only one
change is needed instead of 3
2019-11-18 11:00:24 -06:00
Jeff Epler acde22a436 circuitpy_mpconfig.h: Move includes after include-guard
To benefit from gcc's "once-only headers" implementation, the
"wrapper-#ifndef" must be the first non-comment part of the file,
according to the manual for various gcc/cpp versions.
2019-11-18 11:00:24 -06:00
Dan Halbert 9000c88965
Merge pull request #2295 from jepler/make-translate-xargs
Makefile: Fix a problem where `xargs` invoked `xgettext` 2x
2019-11-18 11:04:02 -05:00
Jeff Epler 37fd08e637 workflows: Don't try to upload when running in someone's fork
.. which we can tell by whether the environment variable is non-empty
2019-11-17 21:21:30 -06:00
Jeff Epler 8e9ac59396 Makefile: Fix a problem where `xargs` invoked `xgettext` 2x
On a Debian 10 system, the number of arguments to xargs was such that
it would not fit in a single invocation (xargs --show-limits prints
"bytes: Size of command buffer we are actually using: 131072").

In this situation, the output from the second invocation of xgettext
would replace the output of the first one, so messages that appeared only
in files early in the list would be lost.  Strings in "extmod" were most
frequently the victim, including "incorrect padding" from modubinascii.c.

Unfortunately, when the github environment was similar enough to the
environment where "make translate" was invoked, the problem was not
found by "check-translate", because the same (incorrect, truncated)
potfile would be generated on both systems.  Apparently Ubuntu and Debian
were different enough that the problem could become visible.

xgettext has a mode where it reads files from stdin ('-f-'), but this does
not have a zero-delimited variant documented.  Still, we will assume
that files with adversarial names are not committed to circuitpython
or created by the build process, and print newline-delimited filenames
from `find` to be processed by `xgettext -f-`.
2019-11-17 21:00:07 -06:00
Jeff Epler 900e365f93 locale: Re-run "make translate" subsequent to the xargs/xgettext fix
I manually inspected the changes relative to 5.0.0-alpha.5-93-g8778f367e
and believe they are innocuous; Besides restoring some translations
that had become fuzzy, "c-format" was removed from many (all?) fuzzy
messages, and the word-wrapping of one message was changed.
2019-11-17 20:59:14 -06:00
Jeff Epler 6700a58a17 Makefile: Fix a problem where `xargs` invoked `xgettext` 2x
On a Debian 10 system, the number of arguments to xargs was such that
it would not fit in a single invocation (xargs --show-limits prints
"bytes: Size of command buffer we are actually using: 131072").

In this situation, the output from the second invocation of xgettext
would replace the output of the first one, so messages that appeared only
in files early in the list would be lost.  Strings in "extmod" were most
frequently the victim, including "incorrect padding" from modubinascii.c.

Unfortunately, when the github environment was similar enough to the
environment where "make translate" was invoked, the problem was not
found by "check-translate", because the same (incorrect, truncated)
potfile would be generated on both systems.  Apparently Ubuntu and Debian
were different enough that the problem could become visible.

xgettext has a mode where it reads files from stdin ('-f-'), but this does
not have a zero-delimited variant documented.  Still, we will assume
that files with adversarial names are not committed to circuitpython
or created by the build process, and print newline-delimited filenames
from `find` to be processed by `xgettext -f-`.
2019-11-17 20:54:21 -06:00
Jeff Epler c449748663 locale: commit results of running "make translate" 2019-11-17 20:21:18 -06:00