summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2020-10-10rgbmatrix: update protomatter to 1.0.5 tagJeff Epler
this is compile-tested on stm32f405 feather matrixportal nrf52840 feather but not actually tested-tested.
2020-10-03Update protomatterJeff Epler
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-09-25Update TinyUSB to get MIDI SysEx fixScott Shawcroft
Fixes #3465
2020-09-03Merge remote-tracking branch 'adafruit/main' into native_wifiScott Shawcroft
2020-09-01rgbmatrix: recover gracefully from allocation errorsJeff Epler
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-08-27Merge remote-tracking branch 'adafruit/main' into native_wifiScott Shawcroft
2020-08-25Merge remote-tracking branch 'adafruit/main' into native_wifiScott Shawcroft
2020-08-25pyexec: Handle a ctrl-c that comes in "very late"Jeff Epler
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-19Handle home, delete, & emacs key w/ utf-8 in replGeorge Waters
2020-08-19Add basic error handlingScott Shawcroft
2020-08-09Count utf8 chars, not every byte for lineGeorge Waters
2020-08-09Try too make new utf-8 code smaller againGeorge Waters
2020-08-09Fix failed unix buildGeorge Waters
2020-08-09Refactor utf-8 code, reduce impact on code sizeGeorge Waters
2020-08-09Fix repl support for unicodeGeorge Waters
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-04libm: rem_pio2: Reduce size of static arrayJeff Epler
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-04libm: ef_rem_pio2.c: Save ROM-tables at the expense of speedJeff Epler
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-07-29update tinyusb to commit 22100b252hathach
fix warnings on esp32s2 and stm32
2020-07-29update tinyusb from commmit dc5445e2f to 78f1576e9hathach
2020-07-22Merge branch 'main' into stm32-timer-allocatorhierophect
2020-07-16Check out active protomatter PRLucian Copeland
2020-07-13Merge pull request #3003 from Flameeyes/masterScott Shawcroft
License tagging according to REUSE specifications.
2020-07-09lib/mp3: update to 1.2.2 releaseJeff Epler
This fixes the audio clipping bug
2020-07-06Add license to some obvious files.Diego Elio Pettenò
2020-06-03Fix up end of file and trailing whitespace.Diego Elio Pettenò
This can be enforced by pre-commit, but correct it separately to make it easier to review.
2020-05-21lib: tinyusb: update to get tud_task_is_queue_emptySean Cross
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-18Update TinyUSB and shorten USB task delayScott Shawcroft
2020-05-07Fix build after #2831 (stm32f4xx rgbmatrix) broke itJeff Epler
2020-05-06Merge pull request #2831 from jepler/rgbmatrix-stmScott Shawcroft
stm: enable RGBMatrix
2020-04-30stm: enable protomatterJeff Epler
Testing performed: on stm32f405 feather, all pins change in plausible ways on a logic probe. Didn't actually drive a display yet.
2020-04-29Update TinyUSB to include SAMD race fixScott Shawcroft
2020-04-27Merge remote-tracking branch 'adafruit/master' into lower_powerScott Shawcroft
2020-04-23Even newer tinyUSBScott Shawcroft
2020-04-17Update TinyUSB and add interrupt hooks.Scott Shawcroft
2020-04-14nrf: protomatter portJeff Epler
2020-04-14Add Protomatter and FramebufferDisplayJeff Epler
2020-03-03Merge remote-tracking branch 'origin/master' into ulabJeff Epler
2020-02-28oofatfs: Remove _FS_DISK_READ_ALIGNEDJeff Epler
This workaround is no longer needed, so it can be removed. Closes: #2332
2020-02-27libm: Provide log2fJeff Epler
2020-02-27libm: Disable float-equal diagnosticsJeff Epler
I choose to believe these authors knew what they were doing.
2020-02-18Update readline.c for REPL Unicode issue 1905DavePutz
2020-01-17Refine iMX RT memory layout and add three boardsScott Shawcroft
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.
2019-12-27more tinyusb updatehathach
2019-12-26sync with https://github.com/hathach/tinyusb/pull/246hathach
should fix slow enumeration
2019-12-26improve usb dcd samd51hathach
fix race condition with setup packet + scsi status response
2019-12-19mp3: update to upstream release 1.1.1Jeff Epler
2019-12-17bump tinyusb lib submodulehathach
2019-12-10audiocore: Add MP3File using Adafruit_MP3 libraryJeff Epler
2019-12-10nRF: disk_read must be 4-byte alignedJeff Epler
.. a requirement that oofatfs needs to be taught to respect. This problem can be demonstrated with the following snippet, except that the related file ("test.bin") must also be contiguous on the filesystem. You can ensure this by reformatting your device's filesystem before testing, then copying any single file bigger than 4kB to test.bin. f = open("test.bin", "rb") f.seek(2048) b = bytearray(2048) v = memoryview(b) f.readinto(v[909:]) Closes: #2332
2019-12-04protocols: Allow them to be (optionally) type-safeJeff Epler
Protocols are nice, but there is no way for C code to verify whether a type's "protocol" structure actually implements some particular protocol. As a result, you can pass an object that implements the "vfs" protocol to one that expects the "stream" protocol, and the opposite of awesomeness ensues. This patch adds an OPTIONAL (but enabled by default) protocol identifier as the first member of any protocol structure. This identifier is simply a unique QSTR chosen by the protocol designer and used by each protocol implementer. When checking for protocol support, instead of just checking whether the object's type has a non-NULL protocol field, use `mp_proto_get` which implements the protocol check when possible. The existing protocols are now named: protocol_framebuf protocol_i2c protocol_pin protocol_stream protocol_spi protocol_vfs (most of these are unused in CP and are just inherited from MP; vfs and stream are definitely used though) I did not find any crashing examples, but here's one to give a flavor of what is improved, using `micropython_coverage`. Before the change, the vfs "ioctl" protocol is invoked, and the result is not intelligible as json (but it could have resulted in a hard fault, potentially): >>> import uos, ujson >>> u = uos.VfsPosix('/tmp') >>> ujson.load(u) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: syntax error in JSON After the change, the vfs object is correctly detected as not supporting the stream protocol: >>> ujson.load(p) Traceback (most recent call last): File "<stdin>", line 1, in <module> OSError: stream operation not supported