Commit Graph

436 Commits

Author SHA1 Message Date
Scott Shawcroft
3fda0c0a1b
Fix board builds and use MP_ERROR_TEXT in py and extmod 2021-05-05 17:51:52 -07:00
Scott Shawcroft
f0bb26d70f
Merge MicroPython 1.13 into CircuitPython 2021-05-04 18:06:33 -07:00
Scott Shawcroft
b35fa44c8a
Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
Scott Shawcroft
76033d5115
Merge MicroPython v1.11 into CircuitPython 2021-04-26 15:47:41 -07:00
Scott Shawcroft
09f7b43c64
Merge MicroPython 1.10 into CircuitPython 2021-04-21 15:59:17 -07:00
Scott Shawcroft
b057fb8a4b
codeformat 2021-04-19 22:22:44 -07:00
Jeff Epler
95a75b0410 update protomatter 2021-04-13 08:48:40 -05:00
hathach
7c3975ecf2 update tinyusb to fix midi buffer overflow issue 2021-04-02 17:57:56 +07:00
microDev
a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
Jeff Epler
c95def0b32 raspberrypi: Enable mp3 playback
The rp2040 is _very_ marginal for mp3 playback, and currently sometimes triggers a bug that gives garbled audio output.  However, it does work for some limited situations.
2021-03-10 18:44:10 -06:00
Scott Shawcroft
e3d4036f2e
Update TinyUSB 2021-03-08 17:24:03 -08:00
Dan Halbert
b1268107af change esp build cache key (again) 2021-03-04 15:22:56 -05:00
hathach
c26120a3ac update tinyusb 2021-03-04 21:29:04 +07:00
Jeff Epler
407a8c222a protomatter: get an rp2 fix by updating 2021-03-01 15:13:47 -06:00
Jeff Epler
1d1ff5f308 Merge remote-tracking branch 'origin/main' into update-protomatter-rp2 2021-02-26 09:56:35 -06:00
Kamil Tomaszewski
dafdd246bc Update tinyUSB 2021-02-24 18:27:54 +01:00
Kamil Tomaszewski
ced820c8a7 Update tinyUSB 2021-02-24 18:19:18 +01:00
Jeff Epler
ff1942cff6 Enable protomatter on RP2040 builds
Also found a race condition between timer_disable and redraw, which
would happen if I debugger-paused inside common_hal_rgbmatrix_timer_disable
or put a delay or print inside it.  That's what pausing inside reconstruct
fixes.

So that the "right timer" can be chosen, `timer_allocate` now gets the `self`
pointer.  It's guaranteed at this point that the pin information is accurate,
so you can e.g., find a PWM unit related to the pins themselves.
This required touching each port to add the parameter even though it's
unused everywhere but raspberrypi.
2021-02-12 08:25:15 -06:00
Jeff Epler
51f0544405 protmatter: Update to version that supports tiling 2021-01-26 09:19:44 -06:00
Kamil Tomaszewski
30a1c52e75 Update TinyUSB 2021-01-25 18:40:14 +01:00
Scott Shawcroft
b73b30ff9f
Switch to upstream TinyUSB 2021-01-21 11:33:13 -08:00
Scott Shawcroft
733094aead
Add initial RP2040 support
The RP2040 is new microcontroller from Raspberry Pi that features
two Cortex M0s and eight PIO state machines that are good for
crunching lots of data. It has 264k RAM and a built in UF2
bootloader too.

Datasheet: https://pico.raspberrypi.org/files/rp2040_datasheet.pdf
2021-01-20 19:16:56 -08:00
Jeff Epler
8e51139da0 update uzlib to v2.9.5
uzlib isn't actually used in any firmwares, but is built into the
"unix" port used for testing.

The main benefit of the update is to fix problems encountered on
Windows, as the old ref of uzlib had filenames with embedded colons;
this has been fixed upstream.

uzlib seems to have been reabsed since the version that we took; this
doesn't really matter to us.
2021-01-14 13:45:42 -06:00
Dan Halbert
39c166ba6a update tinyusb; _ticks_enabled only for SAMD21 2021-01-08 13:30:11 -05:00
Dan Halbert
8b7c23c1ee address review comments 2020-12-01 20:01:14 -05:00
hathach
bafa0501d1 update to have tud_connected() 2020-11-24 22:06:59 +07:00
hathach
5351a93c70 update tinyusb to fix cdc connection race
issue is fixed in https://github.com/hathach/tinyusb/pull/557
2020-11-23 13:39:14 +07:00
Jeff Epler
b293aa7e09 protomatter: Update to upstream tag 1.0.10
Among other things this fixes a problem with blanking the display
and Closes #3664.
2020-11-10 09:12:16 -06:00
Jeff Epler
5e38bb98cb rgbmatrix: update protomatter to 1.0.5 tag
this is compile-tested on
 stm32f405 feather
 matrixportal
 nrf52840 feather

but not actually tested-tested.
2020-10-10 14:30:37 -05:00
Jeff Epler
1cdc91dce6 Update protomatter
This brings in the following, and updates us to the 1.0.4 release tag:

Submodule lib/protomatter 2a1ba8fa4..5f07ec618:
  > Bumping version for release
  > Merge pull request #21 from makermelissa/master
  > Merge pull request #20 from makermelissa/master
  > Merge pull request #18 from jepler/fix-cpy-3184
  > Merge pull request #14 from hierophect/cpy-timer-allocator

We previously had the _changes_ of jepler/fix-cpy-3184 and
hierophect/cpy-timer-allocator but not their merge commits.

The only other changes in protomatter were one formatting change in the
core, plus several Arduino sketches.  So this should make no practical
difference for CPy.
2020-10-03 13:21:58 -05:00
Scott Shawcroft
73d08df9ad
Update TinyUSB to get MIDI SysEx fix
Fixes #3465
2020-09-25 12:23:31 -07:00
Scott Shawcroft
96cf60fbbd
Merge remote-tracking branch 'adafruit/main' into native_wifi 2020-09-03 16:34:56 -07:00
Jeff Epler
2f120c70ee rgbmatrix: recover gracefully from allocation errors
e.g., allocating a 192x32x6bpp matrix would be enough to trigger this
reliably on a Metro M4 Express using the "memory hogging" layout.
Allocating 64x32x6bpp could trigger it, but somewhat unreliably.

There are several things going on here:
 * we make the failing call with interrupts off
 * we were throwing an exception with interrupts off
 * protomatter failed badly in _PM_free when it was partially-initialized

Incorporate the fix from protomatter, switch to a non-throwing malloc
variant, and ensure that interrupts get turned back on.

This decreases the quality of the MemoryError (it cannot report the size
of the failed allocation) but allows CircuitPython to survive, rather
than faulting.
2020-09-01 10:55:45 -05:00
Scott Shawcroft
767ca5c3dc
Merge remote-tracking branch 'adafruit/main' into native_wifi 2020-08-27 11:42:31 -07:00
Scott Shawcroft
8b71e26abd
Merge remote-tracking branch 'adafruit/main' into native_wifi 2020-08-25 16:39:23 -07:00
Jeff Epler
e9bc8e892b pyexec: Handle a ctrl-c that comes in "very late"
In relatively unusual circumstances, such as entering `l = 17 ** 17777`
at the REPL, you could hit ctrl-c, but not get KeyboardInterrupt.
This can lead to a condition where the display would stop updating (#2689).
2020-08-25 11:45:00 -05:00
Damien George
badd351150 lib/timeutils: Add helper functions to deal with nanosecs since 1970.
Signed-off-by: Damien George <damien@micropython.org>
2020-08-22 15:41:10 +10:00
George Waters
ebabc5db37
Handle home, delete, & emacs key w/ utf-8 in repl 2020-08-19 23:25:20 -04:00
Scott Shawcroft
eb8b42aff1
Add basic error handling 2020-08-19 14:23:28 -07:00
George Waters
398be76bf6
Count utf8 chars, not every byte for line 2020-08-09 14:07:13 -04:00
George Waters
93829e57b2
Try too make new utf-8 code smaller again 2020-08-09 13:14:02 -04:00
George Waters
41ccbbd4e9
Fix failed unix build 2020-08-09 13:14:02 -04:00
George Waters
71ce480dbb
Refactor utf-8 code, reduce impact on code size 2020-08-09 13:14:02 -04:00
George Waters
1d410bb68b
Fix repl support for unicode
Currently when a utf8 character that is bigger than 1 byte is typed in
the repl, it isn't handled how it should be. If you try to move the
cursor in any direction the text gets messed up. This fixes that.
2020-08-09 13:14:01 -04:00
Jeff Epler
c0b32976e8 libm: rem_pio2: Reduce size of static array
This array was of 32-bit values, but the entries were only ever
in the 0-255 range.  Convert to uint8_t.

Testing performed: The result of the sum-of-sin was unchanged
>>> import math; sum(math.sin(2.**i) for i in range(21))
1.42069
2020-08-04 14:45:45 -05:00
Jeff Epler
d3fb6c96da libm: ef_rem_pio2.c: Save ROM-tables at the expense of speed
This function computes the remainder of a value `x` modulo pi/2, to high
precision.

It does this by dividing the flotaing point values into several ranges
by magnitude, and applies successively slower but more accurate algorithms.

The last two steps, one covering values up to around 2^7 * pi/2
(called "medium size") and a final one covering all possible float values,
require big tables.

By eliminating the "medium size" case, a table and some code are removed
from the binary.  This makes some cases take longer, but saves hundreds
of bytes.  It does _NOT_ affect the result, only the speed.

```
[desktop python]
>>> sum(math.sin(2.**i) for i in range(21))
1.4206898748939305

[trinket m0, before change to ef_rem_pio2.c]
>>> sum(math.sin(2.**i) for i in range(21))
1.42069

[trinket m0, after change to ef_rem_pio2.c]
>>> sum(math.sin(2.**i) for i in range(21))
1.42069
```
2020-08-04 14:45:45 -05:00
hathach
93cc505144
update tinyusb to commit 22100b252
fix warnings on esp32s2 and stm32
2020-07-29 19:18:46 +07:00
hathach
9f3bddbcb2
update tinyusb from commmit dc5445e2f to 78f1576e9 2020-07-29 16:23:21 +07:00
hierophect
e232ec10ce
Merge branch 'main' into stm32-timer-allocator 2020-07-22 13:59:39 -04:00
Damien George
d9b7261024 lib/libc: Fix string0's implementation of strncpy.
Fixing 98e583430f, the semantics of strncpy
require that the remainder of dst be filled with null bytes.

Signed-off-by: Damien George <damien@micropython.org>
2020-07-22 16:29:54 +10:00