Commit Graph

299 Commits

Author SHA1 Message Date
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
hathach 554373fdd9 bump tinyusb lib submodule 2019-12-17 22:26:08 +07:00
Jeff Epler a08d9e6d8e audiocore: Add MP3File using Adafruit_MP3 library 2019-12-10 14:03:06 -06:00
Jeff Epler a484a93b29 nRF: disk_read must be 4-byte aligned
.. 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-10 14:03:06 -06:00
Jeff Epler 238e121236 protocols: Allow them to be (optionally) type-safe
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
2019-12-04 09:29:57 -06: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 fe6ec9a7d4 Added Edgebadge alias for Pybadge 2019-11-19 14:53:58 -08:00
Scott Shawcroft 47e50e5659
Merge remote-tracking branch 'adafruit/master' into bleio_tweaks 2019-11-01 13:20:58 -07:00
Hierophect dadfa69061 remove old library 2019-10-22 13:13:22 -04:00
Scott Shawcroft ae30a1e5aa
Refine _bleio
This PR refines the _bleio API. It was originally motivated by
the addition of a new CircuitPython service that enables reading
and modifying files on the device. Moving the BLE lifecycle outside
of the VM motivated a number of changes to remove heap allocations
in some APIs.

It also motivated unifying connection initiation to the Adapter class
rather than the Central and Peripheral classes which have been removed.
Adapter now handles the GAP portion of BLE including advertising, which
has moved but is largely unchanged, and scanning, which has been enhanced
to return an iterator of filtered results.

Once a connection is created (either by us (aka Central) or a remote
device (aka Peripheral)) it is represented by a new Connection class.
This class knows the current connection state and can discover and
instantiate remote Services along with their Characteristics and
Descriptors.

Relates to #586
2019-10-21 18:57:03 -07:00
Dan Halbert a0d18ac4e6 add dummy common_hal_mcu_processor_get_voltage() for spresense 2019-10-15 09:07:12 -04:00
Kamil Tomaszewski 49db102bdd Update tinyUSB 2019-10-09 08:32:58 +02:00
Dan Halbert 05038ea1e5 Update tinyusb to fix gamepad;add HID OUT interface descriptor 2019-10-01 15:57:16 -04:00
Hierophect 426ddb356e Add support for F412 via latest tinyusb update 2019-09-09 11:42:55 -04:00
Scott Shawcroft 966a48b23a
More size_t usage 2019-08-27 12:49:46 -07:00
Dan Halbert 44b28d1187 update tinyusb to 00c440cb 2019-08-19 19:42:45 -04:00
Jeff Epler 49d8ea648d update tinyusb
This fixes a problem with USB MIDI messages 0xc and 0xd and
Closes: #2057
2019-08-16 07:40:37 -05:00
hathach c921f6637f update tinyusb lib to 0.5.x 2019-07-24 16:46:31 +07:00
Damien George b3939e2513 lib/utils/printf: Exclude __GI_vsnprintf alias for gcc 9 and above.
See issue #4457.
2019-05-11 00:31:40 -05:00
Scott Shawcroft 6440af5c06
Hide the traceback for the ReloadException.
Many users think it's an error when it's us simply stopping the
code.
2019-05-08 14:53:20 -07:00
hathach 9d43a25d6e update tinyusb to fix disconnect/suspend issue with #1681 2019-04-04 17:59:20 -04:00
Scott Shawcroft ab6896206d
Remove lwip submodule because it is unused. 2019-03-29 15:03:10 -07:00
Scott Shawcroft 1b97325418
Update TinyUSB to fix CDC OUT buffering
Fixes #1630
2019-03-26 16:15:52 -07:00
Dan Halbert d218069f03
Merge pull request #1584 from tannewt/disable_concurrent_write_protection
Add option to disable the concurrent write protection
2019-02-21 17:15:50 -05:00
Scott Shawcroft 1a0596a2fb
Add option to disable the concurrent write protection
This allows writing to the filesystem from the host computer and
CircuitPython by increasing the risk of filesystem corruption.
2019-02-21 10:45:41 -08:00
Craig Forbes 1532863d83 Set __file__ for the main source file (e.g. code.py, main.py) 2019-02-20 21:37:29 -06:00
Scott Shawcroft e6b140e7a0
Support print("", flush=True)
Fixes #1127
2019-02-15 16:53:19 -08:00
Lionel Debroux 591eb23e0f Fix a couple variable shadowing varnings.
Signed-off-by: Lionel Debroux <lionel_debroux@yahoo.fr>
2019-02-07 20:10:43 +01:00
Scott Shawcroft a393a6e0c5
Add fast seek support to file objects 2019-02-03 13:41:20 -08:00