Commit graph

992 commits

Author SHA1 Message Date
Neradoc
d439c8501f ignore newly added "clear" characters in the Web Workflow serial 2025-01-04 04:56:48 +01:00
Scott Shawcroft
91ecb6c04b
Fix many builds
* DWC common has been factored out.
* New time API to implement.
2024-12-02 12:37:15 -08:00
Scott Shawcroft
82d000417b
Enable USB on ESP32-P4 2024-11-27 16:06:54 -08:00
Dan Halbert
d0dc144d4d fix ble_serial_connected() 2024-10-03 16:55:00 -04:00
foamyguy
a0d470aa16 webworkflow warn before leaving page during upload. Allow upload to succeed if user clicks into a directory. 2024-09-14 11:50:44 -05:00
Scott Shawcroft
799044c868
Merge remote-tracking branch 'adafruit/9.1.x' into merge_in_9.1.x 2024-09-12 15:14:53 -07:00
Dan Halbert
fad755d5e7
Merge pull request #9616 from tannewt/fix_c6_crash
Three fixes found for ESP32-C6
2024-09-12 18:12:20 -04:00
Scott Shawcroft
b5517cb04b
Always clear RX buffer on CTRL-C
Some serial sources clear their RX buffers and others didn't. This
cause CP to skip into the REPL based on characters typed before the
CTRL-C. The serial file transfer code looks for "press any key"
which is skipped in this case.

Fixes https://github.com/circuitpython/web-editor/issues/238
2024-09-12 13:35:25 -07:00
Scott Shawcroft
03b077dd91
Add deinit() to _bleio.Characteristic
Espressif's Characteristics allocate memory that may be on the
supervisor heap. We need to free it when stopping BLE workflow.
Otherwise, we leak the memory and eventually safe mode.

Fixes #9599
2024-09-12 13:35:25 -07:00
Dan Halbert
e5e9c5ca84
Merge pull request #9469 from dhalbert/merge-from-micropython-v1.22.2
Merge from micropython v1.22.2
2024-08-21 18:11:19 -04:00
Scott Shawcroft
28f3d91752
Unlock DotStar SPI before deinit 2024-08-21 12:44:40 -07:00
Scott Shawcroft
cedd677969
Fix Funhouse and update to IDF 5.3
The Funhouse problem was due to a locking change for SPI. The
Funhouse is one of a few boards with DotStar status LEDs that use
SPI and have this bug.

I thought it might be IDF related so I updated it first. :-)

Fixes #9486
2024-08-15 11:36:37 -07:00
wyrdsec
b580df5ab3
Merge branch 'adafruit:main' into main 2024-08-02 13:42:51 -04:00
Dan Halbert
be6fa2af21 merge from main 2024-07-29 17:41:46 -04:00
Dan Halbert
c11f2af3e7 wip: blink works on trinket M0 2024-07-27 08:06:20 -04:00
Dan Halbert
71f17b08fb wip: fixing compilation 2024-07-26 18:38:46 -04:00
2385aa6dfb Fix socket binding
.. & make web workflow bind to v6 if available. Binding v6 "any"
address also allows v4 connections
2024-07-17 18:00:04 -05:00
bee32ea826 Make return value of recvfrom_into & accept right for v6 addresses
only tested recvfrom_into as can't bind() v6 addresses yet

wifi workflow may be broken by this or maybe it was broken before
2024-07-17 17:15:22 -05:00
dc77f3146f serial_bytes_available: don't double-count bytes on usb cdc
In 9.0.x, serial_bytes_available returned a bool and tud_cdc_available was
harmlessly checked twice for any characters.

When the routine was changed to return an int, the double checking led to
over-reporting the number of characters available. In code that would attempt
to read this many bytes from sys.stdin, this made the read call block since
only 1 byte was actually available.

This behavior came up in the discussion of #9393. I don't mark this bug as
closing that one, because that issue seems to be reporting multiple things that
this change would not address, such as delays in `sys.stdout.write()` or
problems seen while using webserial.
2024-07-03 11:36:30 -05:00
Dan Halbert
21d2c865f1 Fix BLE adv timeout; ESP: don't sched handler on adv finish 2024-07-02 12:13:20 -04:00
Dan Halbert
f66313c93b
Merge pull request #9344 from tannewt/disable_ble_completely
Only start BLE for workflow when desired
2024-06-18 17:01:10 -04:00
Scott Shawcroft
b658ce988b
Only start BLE for workflow when desired
The previous implementation would always start BLE and rely on
advertising logic to make the workflow not available when on USB.

This change removes the "always enable" call in favor of a default
value that is on if 1) we determine we should be discoverable or 2)
we're already bonded over BLE.
2024-06-17 15:40:28 -07:00
Scott Shawcroft
ed2f32fadb
Enable deep sleep on all ESP chips
Features of each chip is documented in this spreadsheet:
https://docs.google.com/spreadsheets/d/1NyKzHOWeWMb8UttDDugeeOANZ4m-idMHM6kiTlUUVIg/edit?usp=sharing

Fixes #9056
2024-06-13 10:26:33 -07:00
Scott Shawcroft
4c85b5f02e
Fix other BLE builds 2024-06-12 11:22:00 -07:00
Scott Shawcroft
63aeb11d7e
Improve ESP BLE and turn on BLE workflow
The BLE workflow will broadcast publicly when the web workflow
isn't activated.
2024-06-11 16:21:40 -07:00
wyrdsec
ce9504f3d6
Merge branch 'adafruit:main' into main 2024-06-08 11:56:47 -04:00
wyrdsec
707026623f
Merge branch 'adafruit:main' into main 2024-06-06 20:30:44 -04:00
Dan Halbert
e4f6656df6 Further fix to use absolute paths in remote workflows 2024-06-06 16:56:24 -04:00
Dan Halbert
6ec5d3fabe web_workflow.c: use absolute path 2024-06-05 23:29:47 -04:00
wyrdsec
1214b699ca Pervasive Displays Aurora E-paper driver 2024-06-05 20:00:45 -04:00
Dan Halbert
3f4d9310ff CircuitPython files: replace STATIC with static 2024-05-20 11:02:17 -04:00
Dan Halbert
950b5d09d2 guard2once -s ... 2024-05-19 20:40:44 -04:00
Dan Halbert
dbef48d5e2 add #pragma once to all CircuitPython header files without any include guards 2024-05-19 20:38:07 -04:00
Dan Halbert
747b7619ea update headers of most CircuitPython-only files 2024-05-17 14:56:28 -04:00
Dan Halbert
daa11cb1c2 updates before header conversion 2024-05-17 14:56:28 -04:00
Scott Shawcroft
9ab8831d38
Merge pull request #9218 from jepler/mp3-esp
Enable mp3 output on esp32s3
2024-05-02 14:30:07 -07:00
08a440d19b espressif: Don't hold interrupts disabled a long time
.. just to prevent background tasks from running
2024-05-01 10:07:13 -05:00
Scott Shawcroft
6d802fe616
Fix ESP builds 2024-04-29 14:11:38 -07:00
Scott Shawcroft
6cbdb64d03
Fix builds without custom USB ID 2024-04-29 11:46:58 -07:00
Scott Shawcroft
28b7421124
Merge remote-tracking branch 'adafruit/main' into renode 2024-04-29 11:27:19 -07:00
Scott Shawcroft
d4a46ba153
Always define CFG_TUD_ENABLED 2024-04-26 15:36:46 -07:00
Scott Shawcroft
40f6d531b3
Add missing file 2024-04-26 14:27:16 -07:00
Scott Shawcroft
0cbd8b2e0c
Add CIRCUITPY_USB_DEVICE config
This replaces CIRCUITPY_USB and makes room for CIRCUITPY_TINYUSB
when it may only be included for host support.
2024-04-26 11:58:49 -07:00
Scott Shawcroft
b63d422768
Fix more boards and docs 2024-04-23 16:04:42 -07:00
Scott Shawcroft
442def3e68
Add minimal Renode port
This runs in the Renode simulator and enables easier tracing and
debugging of the CircuitPython core. This port can also serve as
a starting point for new ports because it implements the minimal
necessary for the CP core to run.
2024-04-23 13:31:31 -07:00
Dan Halbert
c35ec758dd Merge remote-tracking branch 'adafruit/9.0.x' into 9.0.4-update 2024-04-17 15:39:10 -04:00
Dan Halbert
98957cccd8 change unneeded uint8_t decls to size_t or uint32_t 2024-04-11 14:15:41 -04:00
Dan Halbert
2fa97f3872 fix flash_cache_table allocation failures; clean up code 2024-04-11 14:00:37 -04:00
Scott Shawcroft
aca3191a58
Add Max3421E support for usb host
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
2024-04-10 10:57:28 -07:00
Joshua
8b8927b24a Readded misssing prototypes. 2024-04-07 06:07:53 +09:30
Dan Halbert
817a7fa4af
Merge branch 'main' into main 2024-04-06 16:21:01 -04:00
Joshua
3d183bbc5f Fixed board_serial_bytes_available prototype error. 2024-04-07 05:30:56 +09:30
Joshua
e956f2994b Updated to use ringbuf and an event callback. 2024-04-06 12:53:08 +10:30
Dan Halbert
064ac2d932 address review; fix STM; add limitation for STM 2024-04-06 09:26:59 +10:30
Dan Halbert
e847999a42 Runtime.serial_bytes_available: return count isntead of bool 2024-04-06 09:26:58 +10:30
Joshua
4d8310e374 Fixed precommit spacing problems. 2024-04-05 12:55:14 +10:30
Joshua
090f330ad5 Added support for Cardputer keyboard input. 2024-04-05 10:39:04 +10:30
Dan Halbert
4b44e324a5 address review; fix STM; add limitation for STM 2024-04-04 13:30:57 -04:00
Dan Halbert
bb9968215c Runtime.serial_bytes_available: return count isntead of bool 2024-04-04 12:26:06 -04:00
Scott Shawcroft
12b4ac13e3
Call vTaskDelay directly in usb_background
This minimizes the delay added. (`port_yield()` does vTaskDelay(4)
so low priority tasks run.)
2024-03-05 15:56:11 -08:00
Scott Shawcroft
e0c6302b73
Improve RGBMatrix reliability
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
2024-03-05 12:29:05 -08:00
Dan Halbert
d8bd26c560
Merge pull request #9005 from jepler/issue8980
Postpone interacting with the web workflow if a SPI bus is locked
2024-03-05 12:00:33 -05:00
c0064dcf9f Postpone interacting with the web workflow if a SPI bus is locked
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
2024-03-04 20:23:37 -06:00
Dan Halbert
78cbc8378c
Merge pull request #8994 from tannewt/ww_default_writable
Grab FS lock to test writability
2024-03-04 16:54:24 -05:00
Scott Shawcroft
9cc668b65d
Revert most changes. Only change web workflow writable 2024-03-04 13:45:06 -08:00
hathach
3d88402331
call tuh_hid_receive_abort() when detach from kernel driver
- 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
2024-03-04 18:16:32 +07:00
Scott Shawcroft
ddf9aec00e
Grab FS lock to test writability
Checking is_writable_from_python always follows USB policy even if
it is unplugged. Fixes #8986

Also does bare minimum for #8961.
2024-02-29 14:05:11 -08:00
Scott Shawcroft
02a488649f
Merge pull request #8923 from jepler/groups-in-rom
displayio: add, check "readonly" flag for groups
2024-02-16 09:49:14 -08:00
339d01f58b Prevent out-of-range reads via msc
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
2024-02-16 10:28:53 -06:00
d7dd571326 Rename the "in_rom" flag to "readonly" 2024-02-15 22:17:00 -06:00
Scott Shawcroft
f037a1202a
Require 64 bytes extra CDC RX buffer
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
2024-02-15 16:24:06 -08:00
75ec56844c displayio: add, check "in rom" flag for groups
closes: #8873
2024-02-14 19:39:00 -06:00
Scott Shawcroft
9537b1dca7
Improve neopixel on ESP
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
2024-02-14 15:10:07 -08:00
Scott Shawcroft
cd28f1d678
Merge pull request #8860 from jepler/create-sd-placeholder
supervisor: Create a file /sd/placeholder.txt with a note
2024-02-02 09:54:48 -08:00
Scott Shawcroft
221af8770e
Update placeholder text 2024-02-01 10:18:43 -08:00
3a9e439d64 update placeholder.txt contents based on review comment 2024-01-31 12:40:50 -06:00
da5ba9a76a Rename & improve doc 2024-01-31 12:03:12 -06:00
1c95a85ceb Merge remote-tracking branch 'origin/main' into q-and-d-uvc 2024-01-31 08:27:13 -06:00
96ef9c0caf don't create placeholder.txt if it'll just be empty 2024-01-29 16:48:21 -06:00
7c3adbff8f annotate function that may be unused 2024-01-29 16:04:08 -06:00
d09dd6d4ea Revert "supervisor: Put more info in settings.toml"
This reverts commit 02ddb3cacc.
2024-01-29 16:03:06 -06:00
02ddb3cacc supervisor: Put more info in settings.toml
This list sadly has to be kept manually up to date, but it may be
helpful to people!
2024-01-29 14:00:11 -06:00
056ca321b1 supervisor: Create sd/placeholder.txt
.. so that a freshly formatted CP device can mount an SD card at `/sd`.
2024-01-29 13:57:59 -06:00
616b14fd8d supervisor: Prepare for multiple files with optional contents 2024-01-29 13:57:44 -06:00
ebe839044f
Merge pull request #8807 from iyalosovetsky/main
usb_host keyboard, keys f1-f12, ctrl-left, ctrl-right, ctrl-up, ctrl-down, page down, page up, insert, delete, pause in VT100 CSI
2024-01-28 15:05:01 -06:00
a28e92974e Fix keypad page up
This bug was always present in the key map.
2024-01-28 11:45:46 -06:00
fa2e365f6c Reorder FLAG_STRING | FLAG_CTRL lines
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.
2024-01-28 11:45:26 -06:00
1983ddad86 Remove commented-out lines 2024-01-28 11:44:11 -06:00
Dan Halbert
370b011081
Merge pull request #8830 from dhalbert/hid-wakeup
shared-module/usb_hid: allow HID to wake sleeping host computer
2024-01-25 14:44:02 -05:00
Dan Halbert
9aa73fd43f shared-module/usb_hid: allow HID to wake sleeping host computer 2024-01-24 11:12:49 -05:00
Scott Shawcroft
9538e0067b
Merge remote-tracking branch 'adafruit/main' into ww_sd_card 2024-01-22 17:14:06 -08:00
6b74263a71
uvc: Experimental module for USB video
This allows the CircuitPython device to act as a UVC video source.
2024-01-22 10:44:42 -06:00
Ihor Yalosovetskyi
5f5e4a6f16 rc03 ctrl with f1-f12 ins del pgdown pgup home end bug fix 2024-01-20 17:30:53 +02:00
Ihor Yalosovetskyi
5ff4d345d8 rc03 ctrl with f1-f12 ins del pgdown pgup home end bug fix 2024-01-20 17:25:26 +02:00
Scott Shawcroft
61ec3280d1
Optimize error messages 2024-01-19 21:31:58 -08:00
Ihor Yalosovetskyi
a63752340e rc02 ctrl with f1-f12 ins del pgdown pgup home end 2024-01-20 05:06:11 +02:00
Ihor Yalosovetskyi
60673579cb rc02 ctrl with f1-f12 ins del pgdown pgup home end 2024-01-20 04:44:45 +02:00
Ihor Yalosovetskyi
769e7533bf rc02 ctrl with f1-f12 ins del pgdown pgup home end 2024-01-20 04:42:21 +02:00
Ihor Yalosovetskyi
045a48af67 rc01 2024-01-19 15:58:12 +02:00
Scott Shawcroft
234ce7cfa4
Fix move, mkdir and tweak dir listing
Makes sure mount point is a directory.

Fixes #8110 by making it explicit that progress is per-file.
2024-01-18 14:22:16 -08:00