Commit Graph

327 Commits

Author SHA1 Message Date
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
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
Lucian Copeland cdfc3a2d37 Check out active protomatter PR 2020-07-16 12:08:40 -04:00
Scott Shawcroft 51c888d4be
Merge pull request #3003 from Flameeyes/master
License tagging according to REUSE specifications.
2020-07-13 16:28:49 -07:00
Jeff Epler f1509debc3 lib/mp3: update to 1.2.2 release
This fixes the audio clipping bug
2020-07-09 10:05:08 -05:00
Diego Elio Pettenò 34b4993d63 Add license to some obvious files. 2020-07-06 19:16:25 +01:00
Diego Elio Pettenò dd5d7c86d2 Fix up end of file and trailing whitespace.
This can be enforced by pre-commit, but correct it separately to make it easier to review.
2020-06-03 10:56:35 +01:00
Sean Cross 5ed4e4d0ab lib: tinyusb: update to get tud_task_is_queue_empty
This update gives us access to a function we can run with interrupts
disabled to determine if the queue is empty.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-21 21:34:44 +08:00
Scott Shawcroft 164628282d
Update TinyUSB and shorten USB task delay 2020-05-18 17:27:49 -07:00
Jeff Epler 182ae10080 Fix build after #2831 (stm32f4xx rgbmatrix) broke it 2020-05-07 18:32:50 -05:00
Scott Shawcroft c3b3eb4c21
Merge pull request #2831 from jepler/rgbmatrix-stm
stm: enable RGBMatrix
2020-05-06 08:35:25 -07:00
Jeff Epler e5be728c1c stm: enable protomatter
Testing performed: on stm32f405 feather, all pins change in plausible ways
on a logic probe.  Didn't actually drive a display yet.
2020-04-30 08:58:58 -05:00
Scott Shawcroft 18657b6539
Update TinyUSB to include SAMD race fix 2020-04-29 10:52:26 -07:00
Scott Shawcroft 755d404edf
Merge remote-tracking branch 'adafruit/master' into lower_power 2020-04-27 16:45:10 -07:00
Scott Shawcroft 5a7652ff86
Even newer tinyUSB 2020-04-23 18:03:16 -07:00
Scott Shawcroft 7e3d4c61b5
Update TinyUSB and add interrupt hooks. 2020-04-17 14:16:49 -07:00
Jeff Epler 1d8a073c05 nrf: protomatter port 2020-04-14 18:24:58 -05:00
Jeff Epler 09dc46a984 Add Protomatter and FramebufferDisplay 2020-04-14 18:24:54 -05:00
Jeff Epler da31acfcc4 Merge remote-tracking branch 'origin/master' into ulab 2020-03-03 20:13:53 -06:00
Jeff Epler eef742bf45 oofatfs: Remove _FS_DISK_READ_ALIGNED
This workaround is no longer needed, so it can be removed.

Closes: #2332
2020-02-28 10:04:28 -06:00
Jeff Epler 50438b51aa libm: Provide log2f 2020-02-27 08:30:12 -06:00
Jeff Epler 41e71485af libm: Disable float-equal diagnostics
I choose to believe these authors knew what they were doing.
2020-02-27 08:30:12 -06:00
DavePutz aca53aa1a2
Update readline.c for REPL Unicode issue 1905 2020-02-18 10:38:50 -06:00
Scott Shawcroft 7d8dac9211
Refine iMX RT memory layout and add three boards
Introduces a way to place CircuitPython code and data into
tightly coupled memory (TCM) which is accessible by the CPU in a
single cycle. It also frees up room in the corresponding cache for
intermittent data. Loading from external flash is slow!

The data cache is also now enabled.

Adds support for the iMX RT 1021 chip. Adds three new boards:
* iMX RT 1020 EVK
* iMX RT 1060 EVK
* Teensy 4.0

Related to #2492, #2472 and #2477. Fixes #2475.
2020-01-17 17:36:08 -08:00
hathach adff14c5bc
more tinyusb update 2019-12-27 09:55:16 +07:00
hathach 62c4028cde
sync with https://github.com/hathach/tinyusb/pull/246
should fix slow enumeration
2019-12-26 23:04:16 +07:00
hathach 3492ba33d5
improve usb dcd samd51
fix race condition with setup packet + scsi status response
2019-12-26 00:18:04 +07:00
Jeff Epler 5c42ae1e13 mp3: update to upstream release 1.1.1 2019-12-19 08:13:00 -06:00