It is enabled on:
* SAMD51 boards with 1MB flash (SKU ending in 20A)
* Feather RP2040 DVI. Others have PIO usb host.
* All ESP32 boards.
* All nRF boards
Fixes#8676
The guard against running when flash is disabled isn't perfect and
may lead to calling the row handler anyway. We were crashing due
to mp_hal_delay_us being in flash. So, move it to RAM.
Also move the panic handler to IRAM so we get nice output when this
happens.
Turn off JTAG by default so its pins can be used by code.py.
Fixes#8987
I tested this by fetching a .txt file repeatedly using curl while
running the fancy camera demo. (100+ times without failure). I also
repeatedly loaded the filesystem view http://.../fs/#/sd/ which worked
10+ times without failure, but does take some time (multiple seconds) to
show a listing with a few dozen files.
(I suspect there's an accidentally quadratic behavior in oofatfs to stat
every file in a directory, because it repeatedly does a linear search of
the directory for the stat information of each file, but that's not an
issue for Right Now(TM))
Closes: #8980
- add tuh_event_hook_cb() in SRAM, required when updated to latest tinyusb
- bump up pico-pio-usb to latest
- bump up tinyusb to latest for new tuh_hid_receive_abort(), and all endpoint abort when
SET_CONFIGURATION
Some ports implement their own protection against this at a low level
but it doesn't hurt to add it here instead.
Based on a patch from @drath42
Closes: #8788
Once the buffer has less that an endpoint's worth, TinyUSB won't
request more from the host. When that happens, ctrl-c will no
longer be sent to the device and TinyUSB won't find the wanted
character.
Fixes#4444
Greedily grab as much RMT memory as we can. It blocks other RMT
transmit channels but we only use it temporarily anyway. The more
we can grab, the fewer interrupts are needed to keep the transmit
going.
Flickers may still happen due to file system writes but most of the
time the animation just pauses.
On ESP32, move CircuitPython to the second core. This helps NeoPixel
by moving the RMT interrupt to the second core as well.
When testing ESP32 I noticed that settings.toml writes won't apply
until after hard reset. This removes that constraint but still
requires the password to enable the web workflow.
Fixes#3835
this means that the test for FLAG_CTRL together with FLAG_STRING is
not needed. Instead, the FLAG_STRING | FLAG_CTRL row, when
encountered earlier, will automatically take precedence.
This replaces the earlier, Bitmap-based way of interacting with the
UVC framebuffer.
Typical usage:
```py
displayio.release_displays()
display = frambufferio.FramebufferDisplay(uvc.UVCFramebuffer())
```
This works on a MacroPad with a 128x128 framebuffer, but does not work
on a QT Py esp32s3.
On esp32s3, having the UVC-configuring line alone causes a hard-fault
at startup. However, disabling some other USB devices allows it to boot
and run code.py:
```py
import uvc
import usb_hid
import usb_midi
usb_hid.disable()
usb_midi.disable()
uvc.enable_framebuffer(64, 64)
```
however, as far as I can tell within qv4l2, the device never actually
transmits a frame of data (received frame count never increases).
I have not yet analyzed this failure in further detail.
Added the ability to work with the function keys f1-f12, ctrl-left, ctrl-right, ctrl-up, ctrl-down, page down, page up, insert, delete, pause. in the format of command VT 100
This changes storage.mount() to require that a mount point exist
on the parent file system.
A bug in background tasks is also fixed where the function
parameter is cleared on pending callbacks during "reset".
Disk usage is shown on the directory listing and changes based on
the mounted file system. Writable is also loaded per-directory.
Fixes#8108. Fixes#8690. Fixes#8107.
* Disable Nagle at the end of error messages so they are sent before
the socket is closed.
* Correctly discard file contents when the PUT file is too large.
* Correctly reset file size after failure to setting it too large.
* Change diskinfo.json to be list of disks in preparation of supporting
multiple disks.
* Bump version to 3 for the above change.
* Document diskinfo.json.
Fixes#8109
This simplifies allocating outside of the VM because the VM doesn't
take up all remaining memory by default.
On ESP we delegate to the IDF for allocations. For all other ports,
we use TLSF to manage an outer "port" heap. The IDF uses TLSF
internally and we use their fork for the other ports.
This also removes the dynamic C stack sizing. It wasn't often used
and is not possible with a fixed outer heap.
Fixes#8512. Fixes#7334.
micropython puts the pointer-ness into the typedef; we can put the
const-ness there too.
this reduces the delta to micropython; for instance, emitinlinextensa
and emitinlinethumb now match upstream.
These are moved:
* Display -> busdisplay.BusDisplay
* FourWire -> fourwire.FourWire
* EPaperDisplay -> epaperdisplay.EPaperDisplay
* I2CDisplay -> i2cdisplaybus.I2CDisplayBus
`paralleldisplay` is now `paralleldisplaybus` (and registered as
`paralleldisplay` too).
Bus related helpers are split out of display_core into bus_core.
It is in still displayio since it is a dependency of both
busdisplay and epaperdisplay.
Fixes#7667
.. and switch makerfabs tft7 over to it as a test.
We have our existing way of "reserving" PSRAM for esp-idf (we actually
control it all but add back the "reserved" part). However, this does
not work with off the shelf esp_lcd, which only will allocate a
framebuffer in PSRAM if CONFIG_SPIRAM_USE_CAPS_ALLOC (or CONFIG_SPIRAM_USE_ALLOC)
is defined, not if CONFIG_SPIRAM_USE_MEMMAP is.
This new way is possibly compatible with more esp-idf code, but it complicates
CircuitPython's initial startup since nothing until port_heap_init is
permitted to use the CP heap or supervisor allocator. In practice this
seems to be OK today.
Right now this doesn't change the setting across all boards with PSRAM and so
it does not revert esp-idf to its prior state. Instead, what I'm thinking is
that we can do it during or just after the IDF5 update when sdkconfig files
will be getting an overhaul anyway.
any qstr of >= 3 chars long is a candidate for use; the input byte value
(1) is used to indicate a fixed-length qstr number follows.
Before accounting for the code size changes, this saves ~100 bytes
on trinket m0, but it may end up being a wash due to added code.
A cutoff of length>2 is slightly better for ja and ru and worse for others.
This has to do with the relative frequency of latin characters vs non-latin
characters, is my guess.
lang after before change (- = more free space)
en_US 3132 2996 -134
fr 2136 2060 -76
ja 1916 1724 -232
ru 2196 2000 -196
We have to make room for the status bar no matter if the logo is enabled
or not. We probably should add a similar option for disabling the status
bar.
This makes the PewPew M4 port stop crashing.
(cherry picked from commit b50a7fb913)
We have to make room for the status bar no matter if the logo is enabled
or not. We probably should add a similar option for disabling the status
bar.
This makes the PewPew M4 port stop crashing.
This allows you to initialize usb_host.Port once successfully and
then returns the same object as long as you pass the same arguments
in. It does allow you to fix incorrect pins but not switching from
one valid set to another. (It needs a reset for that.)
This also moves hcd cache operations to RAM so that they don't
access the cache when doing maintenance.
This is confined to pure ASCII, but does support Alt Gr. This is enough
to make a French keyboard layout work:
* home row is "qsdfghjklm"
* numerals are all shifted
* keys like {} require Alt Gr
While not tested, this should also support layouts like Colemak with
the necssary keymap file.
Layouts can be produced from Neradoc's keyboard layout modules on the
device & loaded at runtime. Code to do so is at
https://gist.github.com/jepler/597c0a00e0eb014a433e03c0ae363a08
as well as a sketch of how an extended format could support dead keys &
the full Unicode BMP instead of just ASCII.
and re-organize so that esp32 s2/s3 don't do as much at reset
.. it's not necessary (because most data is in esp-idf managed memory)
and doing this saves me from having to debug why reconstruct isn't working
properly on that platform.
This needs to be tested on other platforms again before being merged!
This adds a script to generate the peripherals files (except clock).
It adds support for the 1015, 1020, 1040, and 1050 EVKs.
Some work was started on 1176 but it isn't working. So, the board
def is in a separate branch.
Fixes#3521. Fixes#2477.
Add address_little_endian for epaper displays with little endian
(low byte first) addresses.
Also clears allocated display and display bus memory so it has a
known state. The acep member wasn't always set so it varied
accidentally.
Fixes#7560. May fix#7778. Fixes#5119.
PicoDVI in CP support 640x480 and 800x480 on Feather DVI, Pico and
Pico W. 1 and 2 bit grayscale are full resolution. 8 and 16 bit
color are half resolution.
Memory layout is modified to give the top most 4k of ram to the
second core. Its MPU is used to prevent flash access after startup.
The port saved word is moved to a watchdog scratch register so that
it doesn't get overwritten by other things in RAM.
Right align status bar and scroll area. This normally gives a few
pixels of padding on the left hand side and improves the odds it is
readable in a case. Fixes#7562
Fixes c stack checking. The length was correct but the top was being
set to the current stack pointer instead of the correct top.
Fixes#7643
This makes Bitmap subscr raise IndexError instead of ValueError
when the index arguments are wrong.
- Move loading .js scripts from <head> to <body> for faster rendering
- Enable back-button support for file system/editor navigation
- Close WebSocket when navigating away from /cp/serial
- Use better looking Blinka icon.
In #7497 port_background_task was renamed to port_background_tick
but the actual call site wasn't changed. This meant that it was
no longer called!
Rename more functions from task to tick to make it clearer which is
which.
Fixes polling thread looping forever hangs preventing new connections.
Don't lose listening sockets on mp resets and re-init.
Keep better separation of "system" and "user" sockets.
Track socket states to prevent re-use of sockets before closed.
Close REST socket when transaction completes. No post-init.
Remove unnecessary state flags.