Commit graph

3146 commits

Author SHA1 Message Date
Dan Halbert
827e41ab2d
Merge pull request #9350 from dhalbert/fix-espressif-ping
espressif: fix returning ping time and pinging too often
2024-06-25 16:42:45 -04:00
Dan Halbert
a004c1685e espressif ping: reduce wait time on failure^ 2024-06-18 15:53:21 -04:00
Dan Halbert
8dc7364b48
Merge pull request #9324 from tannewt/more_esp_deep_sleep
Enable deep sleep on all ESP chips
2024-06-17 23:05:01 -04:00
ed5591c5cb
Merge pull request #9318 from jepler/sslsocket-stream-protocol
SSLSocket: Add stream protocol
2024-06-14 10:02:17 -05: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
7c85f6a15a ensure variable is initialized 2024-06-13 11:41:24 -05:00
e00e2473db doc fix 2024-06-13 11:39:40 -05:00
4d4d654677 MP3Decoder: set the nonblocking flag as needed
this makes SSL sockets (which return readable when not yet actually
readable) work better.
2024-06-13 11:11:17 -05:00
3215f6c4ff SSLSocket: handle exceptions during protocol read/write operations
These protocol operations should not raise exceptions, but sometimes
they do. Catch the exception and extract the errno value if available.

At the same time, harmonize the argument types for the underlying C
routines
2024-06-12 16:41:19 -05: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
7969638740 SSLSocket: Add stream protocol
including select. This assumes that the SSL layer is readable/writable
exactly when the underlying socket is readable/writable.
2024-06-07 14:49:35 -05:00
Scott Shawcroft
1aa17b39b6
Merge pull request #9284 from jepler/mp3-stream
MP3: Stream them
2024-06-06 12:15:30 -07:00
cb295c57d7 MP3Decoder: Make it possible to start in the middle of an MP3
You can now, e.g.,
```
with open("/whatever.mp3") as mp3_file:
    mp3_file.seek(16000*30)
    decoder.file = mp3_file
    i2s.play(decoder)
```
to start about 30 seconds into a 128kbit/s CBR track.

If a track is looped, the loop will start at the beginning.

This also changes the behavior if the track is started & stopped: it will
continue from where it left off, except if it had prevously run to
completion. To get other behavior, you can seek the file and then re-assign
the file property.
2024-06-05 10:33:40 -05:00
Scott Shawcroft
254cac059e
Make time_to_refresh return 0 correctly
Redo Feather C6 pinout so it include standard D# labels for feathers

Fixes #9244
2024-06-03 15:33:11 -07:00
a80311d4c0 MP3Decoder: make testable in coverage build
An mp3 decoder (note that this needs `audiocore.get_buffer`, not
enabled on devices):
```py
import sys
import audiomp3
import audiocore

GET_BUFFER_DONE, GET_BUFFER_MORE_DATA, GET_BUFFER_ERROR = range(3)

with audiomp3.MP3Decoder(sys.argv[1]) as decoder, open(sys.argv[2], "wb") as target:

    while True:
        res, samples = audiocore.get_buffer(decoder)
        if res != GET_BUFFER_ERROR:
            target.write(samples)
        if res != GET_BUFFER_MORE_DATA:
            break
```

this doesn't actually add any tests though
2024-05-30 14:22:39 -05:00
d6ddd55462 MP3Decoder: Allow passing any stream-like object
This can sort-of play MP3s from a http request, but the buffering is
not good enough to play glitch-free. A new kind of buffer that can
read ahead further without blocking is needed.
2024-05-30 14:21:34 -05:00
Dan Halbert
c9b5002897 shared-bindings/analogio/AnalogIn.c: fix Espressif limitations doc 2024-05-24 10:24:25 -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
e0f745c14c
Merge pull request #9247 from jepler/improve-lfo-initial-value
synthio: Calculate LFO.value at construction
2024-05-17 23:48:47 -04:00
Dan Halbert
6c4bfd6738
Merge pull request #9222 from tannewt/esp_ble_server
Add ESP BLE GATT server support
2024-05-17 17:24:45 -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
689c6fac20
Add ESP BLE GATT server support
Enable BLE where we can. Switch 4MB, non-USB board default partitioning
over to a single 2MB firmware bank. Old boards override this setting to
keep the same behavior.

This also adds alpha support for the ESP32-C2 (aka ESP8684).

Fixes #5926 and fixes #7170
2024-05-17 11:08:07 -07:00
Andrew Guest
1865db24f8 Fix typo in start_advertising() param docs 2024-05-14 19:30:03 -05:00
9e878f7b3d synthio: Calculate LFO.value at construction
Originally, the only (non-debug) way to make an LFO calculate its value
was to associate it with a playing synthesizer.

This posed a problem for LFOs that had "power on values" other than 0,
and where the value was used other than to internally drive a note
property.

Now, an initial, possibly non-zero value is calculated at object
construction time:

```py
>>> l = synthio.LFO(offset = 1)
>>> l.value
1.0
```

Note that this happens just once at construction; it does not happen when
updating LFO properties:
```py
>>> l.offset = 2
>>> l.value
1.0
```
2024-05-14 18:27:57 -05:00
Andrew Mirsky
5cace546fe docs/i2ctarget : removed extraneous dependency
Signed-off-by: Andrew Mirsky <andrew@mirsky.net>
2024-05-10 16:36:46 -04:00
Andrew Mirsky
2584fc88f0 ports: rpi pico - i2ctarget update transaction restart register mask
issue #: https://github.com/adafruit/circuitpython/issues/9232

Signed-off-by: Andrew Mirsky <andrew@mirsky.net>
2024-05-10 16:27:50 -04:00
Andrew Mirsky
a9d800b308 docs/i2ctarget: added examples and additional explanation to the I2CTarget() class
Signed-off-by: Andrew Mirsky <andrew@mirsky.net>
2024-05-08 17:02:09 -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
a8170f9930 MP3Decoder: ensure object uses finalizer
.. so that the underlying allocations will be freed. This is not
important now but will be if the underlying allocator is changed
to something else like `port_malloc` in the future.
2024-05-01 14:20:39 -05:00
Scott Shawcroft
28b7421124
Merge remote-tracking branch 'adafruit/main' into renode 2024-04-29 11:27:19 -07:00
Dan Halbert
126a1a4154
Merge pull request #9197 from jepler/synthio-lfo-doc-improvements
LFO: document some things that trip up users
2024-04-29 10:29:31 -04: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
c92bb9b3cc
Merge pull request #8954 from jepler/ssl-anything
ssl: work on anything implementing the socket protocol
2024-04-25 11:51:18 -05:00
Scott Shawcroft
79888acd15
Fix lint, ESP BLE and renode fetch deps 2024-04-24 10:00:36 -07:00
Scott Shawcroft
b63d422768
Fix more boards and docs 2024-04-23 16:04:42 -07:00
8fcb1bfa0d
Update LFO.c 2024-04-23 16:07:03 -05: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
9979e1ac1d Update LFO implementation detail notes based on Dan's feedback
(& re-wrap some paragraphs, sorry)
2024-04-23 07:56:13 -05:00
bf10008c94
Update shared-bindings/synthio/LFO.c
Co-authored-by: Dan Halbert <halbert@adafruit.com>
2024-04-22 21:04:04 -05:00
a4e60ec698 LFO: document some things that trip up users
Closes: #9073

Closes: #9063
2024-04-22 20:40:05 -05:00
Dan Halbert
839fea043c adjust TRRS. Remove busio.UART.Parity if UART disabled 2024-04-21 15:24:12 -04:00
a93cbb21a9 Merge remote-tracking branch 'origin/main' into ssl-anything 2024-04-20 20:57:22 -05:00
Dan Halbert
87a400aa1d
Merge pull request #9189 from dhalbert/pixel-trinkey
Adafruit Pixel Trinkey M0
2024-04-19 10:13:38 -04:00
Dan Halbert
00a18fe2c9 Adafruit Pixel Trinkey M0 2024-04-18 12:45:53 -04:00
Dan Halbert
0c61d51a39 fix typo in SafeModeReason.WATCHDOG doc 2024-04-17 16:15:50 -04:00
2f04028d10 Merge remote-tracking branch 'origin/main' into ssl-anything 2024-04-17 13:45:43 -05:00