Commit graph

5927 commits

Author SHA1 Message Date
foamyguy
332f5ddafb enable depend on CIRCUITPY_DISPLAYIO instead of CIRCUITPY_FULL_BUILD 2025-03-05 10:01:20 -06:00
foamyguy
8d43a2cda6 adding tilepalettemapper 2025-03-04 17:39:02 -06:00
Scott Shawcroft
bc36b94f8b
Merge pull request #10108 from RetiredWizard/vtscroll
Add basic VT100 scrolling
2025-03-04 09:16:39 -08:00
RetiredWizard
0501a8e78f fix for sequence params and compile flag (not enabled yet) 2025-03-03 12:00:46 -05:00
Cooper Dalrymple
762ff43438
Merge branch 'adafruit:main' into audioeffects_pitch_shift 2025-02-17 14:08:14 -06:00
dcooperdalrymple
39df7ca4a8 Initial pitch shift effect implementation. 2025-02-11 13:25:05 -06:00
Randall Scharpf
d64ce00b23 Merge remote-tracking branch 'upstream/main' into main 2025-02-10 14:32:24 -08:00
Randall Scharpf
1942d05c41 Merge branch 'upstream/main' (from adafruit/circuitpython) into main 2025-02-10 11:10:19 -08:00
gamblor21
ff0c7384f4 Initial commit 2025-02-08 12:00:26 -06:00
Scott Shawcroft
e277540f7a
Switch to ruff like MicroPython 2025-02-05 11:09:15 -08:00
Scott Shawcroft
7f0cc9e7b4
Add Zephyr port
This port is meant to grow to encompass all existing boards. For
now, it is a port while we transition over.

It is named `zephyr-cp` to differentiate it from the MicroPython
`zephyr` port. They are separate implementations.
2025-02-04 11:24:13 -08:00
Cooper Dalrymple
e18e5b2d24
Merge branch 'adafruit:main' into audiofilters_distortion 2025-01-17 15:20:09 -06:00
eightycc
038c92a2f5 Serial UART console bug fixes and enhancements. 2025-01-15 18:02:28 -08:00
Dan Halbert
d0b864610b py/objint.c: mark CIRCUITPY-CHANGEs 2025-01-06 13:56:18 -05:00
Dan Halbert
1d90a0ea3e py/objint.c: int.from_bytes and .to_bytes can omit byteorder arg 2025-01-06 11:16:02 -05:00
Damien George
882499569c py/runtime: Fix self arg passed to classmethod when accessed via super.
Thanks to @AJMansfield for the original test case.

Signed-off-by: Damien George <damien@micropython.org>
2024-12-29 13:20:54 -05:00
dcooperdalrymple
48ca21d9a1 Add Distortion to unix port and make type conversions explicit. 2024-12-11 12:35:23 -06:00
eightycc
28a7b51541 Allow boards to select device HCI or native HCI implementation. 2024-12-07 09:32:59 -08:00
Cooper Dalrymple
064c3f310b
Merge branch 'adafruit:main' into audiofilters_distortion 2024-11-13 08:29:13 -06:00
Mark
92ef41083a
Merge pull request #9756 from jepler/synthio-blockbiquad
synthio: Add a form of biquad filter that uses BlockInputs
2024-11-10 17:43:58 -06:00
9113e171ba Throw TypeError when json-serializing invalid types
This behavior is in line with standard Python

Closes: #9768
2024-11-04 09:16:44 -06:00
0d91f1e085 Add global GCC version check
We can set some of them lower than 13 if necessary on a per-port basis.
At least esp32 and arm ports all use 13 from what I could see.
2024-11-01 11:30:24 -05:00
Randall Scharpf
a7b3de416a add SPITarget interface (HAL still unimplemented) 2024-10-31 19:20:43 -07:00
dcooperdalrymple
46ebae1598 Remove separate DistortionMode code files. 2024-10-31 10:33:09 -05:00
9e999bdfb5 need to actually build the files 2024-10-24 11:45:42 -05:00
dcooperdalrymple
16575fc0ef Added Distortion and DistortionMode classes to audiofilters module based on Godot's AudioEffectDistortion class. 2024-10-23 17:19:48 -05:00
dcooperdalrymple
1bf400d2dd Rename biquad property to filter. 2024-10-22 12:08:33 -05:00
Cooper Dalrymple
5246053563 Initial structure for biquad filter effect. 2024-10-22 09:17:58 -05:00
Dan Halbert
95b5d7a6cd Add errno.EROFS and errno.ENOSPC 2024-10-18 16:36:22 -04:00
gamblor21
064c2d8fff Fixed renaming the defines for audioeffects incorrectly 2024-10-14 10:06:06 -05:00
gamblor21
4464531279 Rename defn to add audiodelays 2024-10-12 10:30:42 -05:00
Mark
af171dab84
Merge branch 'main' into audio_effects 2024-10-03 20:38:49 -05:00
gamblor21
ac5ccdba7a Renamed module 2024-09-17 17:52:44 -05:00
gamblor21
5e923038f3 Initial audio effects commit 2024-09-17 17:52:44 -05:00
Dan Halbert
b225a3a2b4 HELP_BUILD_ERROR: link to Learn Guide 2024-09-15 18:27:09 -04:00
Dan Halbert
380d76ba45 py/objfun.h: prevent cast-align warnings 2024-09-14 12:48:49 -04:00
Dan Halbert
ebdf3391e7 turn off ulab.numpy.random, which is large 2024-09-13 16:06:22 -04:00
Dan Halbert
d777cd7d78 Merge remote-tracking branch 'adafruit/main' into merge-micropython-v1.23.0 2024-09-13 15:54:55 -04:00
Dan Halbert
05825a0af9 fix raw_code is_generator and is_async 2024-09-13 11:35:17 -04: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
b65d9e7828 restore async scope flag to previous bit position 2024-09-12 18:06:17 -04:00
Dan Halbert
f40c2cb454 py/mpstate.h: remove permanent_pointers (unused) 2024-09-12 17:59:01 -04:00
Scott Shawcroft
30d57b1ade
Fix gc_alloc_possible()
The BLE workflow was allocating to the VM heap when it wasn't
active and causing a port_malloc.
2024-09-12 13:35:25 -07:00
Dan Halbert
02e11a9413 fix compilation issues; remove more uctypes mentions 2024-09-10 16:04:47 -04:00
Dan Halbert
54ff75410f py/emitglue.c: add is_async 2024-09-09 19:14:16 -04:00
Dan Halbert
bc6f065447 working on compilation errors 2024-09-06 23:10:41 -04:00
Dan Halbert
7812695281 non-conflict merge changes 2024-09-05 14:54:18 -04:00
Dan Halbert
1e1a8000a8 change remaining STATIC to static 2024-09-03 17:40:07 -04:00
Dan Halbert
ac7e15f88a (only) reserve merge conflicts 2024-08-28 16:31:37 -04: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
Dan Halbert
450cb4963e address review comments 2024-08-21 16:50:19 -04:00
wyrdsec
e50f98e30d py/circuitpy_mpconfig.mk: Set compile flag to zero, should be set in
mpconfigboard.mk for individual boards
2024-08-07 21:07:08 -04:00
wyrdsec
6208124bd1
Merge branch 'adafruit:main' into main 2024-08-07 18:01:23 -04:00
Dan Halbert
6f721b3dbe fix more tests; get some tests from v1.23 or later 2024-08-06 22:10:39 -04:00
Dan Halbert
4b0aee4903 fix some tests 2024-08-06 16:23:12 -04:00
wyrdsec
b580df5ab3
Merge branch 'adafruit:main' into main 2024-08-02 13:42:51 -04:00
Daniel Dunn
e7b4522d66 Wifi listen interval 2024-07-30 22:12:25 -06:00
Dan Halbert
be6fa2af21 merge from main 2024-07-29 17:41:46 -04:00
Dan Halbert
014d5a54fc mpy-cross fixes 2024-07-27 16:26:02 -04:00
Dan Halbert
a6a308ce57 smoke tests on RP2040 and nRF52840 (BLE periph tested 2024-07-27 11:22:02 -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
d335a10574 Merge remote-tracking branch 'origin/9.1.x' into merge-91x-main 2024-07-26 13:00:32 -05:00
Dan Halbert
69b667406b MPy v1.22 merge: initial merge; not compiled yet 2024-07-25 15:16:24 -04:00
5811f75a52 Warn on use of nonstandard sys.format_exception 2024-07-24 14:07:54 -04:00
eaa6f99d0e Add v6 address support to SocketPool.getaddrinfo (on espressif) 2024-07-17 12:18:29 -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
wyrdsec
1214b699ca Pervasive Displays Aurora E-paper driver 2024-06-05 20:00:45 -04:00
Damien George
a61c446c0b all: Bump version to 1.23.0.
Signed-off-by: Damien George <damien@micropython.org>
2024-05-31 14:19:55 +10:00
Brian Pugh
c624a5c0c4 py/dynruntime: Export mp_load_method_maybe and mp_arg_parse_all* funcs.
Also define `mp_type_bytearray`.  These all help to write native modules.

Signed-off-by: Brian Pugh <bnp117@gmail.com>
Signed-off-by: Damien George <damien@micropython.org>
2024-05-24 13:50:57 +10:00
Damien George
482292cc66 py/dynruntime: Add mp_obj_exception_init function to create C exception.
Signed-off-by: Damien George <damien@micropython.org>
2024-05-23 14:20:20 +10:00
Dan Halbert
40e4e97368 Merge branch '9.0.x' of https://github.com/adafruit/circuitpython into 9.0.5-merge-to-main 2024-05-22 10:18:56 -04:00
94db02f369 function may be unused 2024-05-21 16:49:10 -04:00
49cbbd198a Fix chaining non-built-in exceptions 2024-05-21 16:41:39 -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
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
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
Scott Shawcroft
9ab8831d38
Merge pull request #9218 from jepler/mp3-esp
Enable mp3 output on esp32s3
2024-05-02 14:30:07 -07:00
34a46de3eb MP3Decoder: Request defined behavior for signed integer shifts
gcc -fsanitize=undefined reports diagnostics like these:
```
../../src/bitstream.c:93:36: runtime error: left shift of 177 by 24 places cannot be represented in type 'int'
../../src/imdct.c:86:53: runtime error: left shift of negative value -937
```

-fwrapv provides implementation-defined behavior that matches the expectations of two's complement arithmetic.
2024-05-01 14:21:03 -05:00
7af2a13245 MP3Decoder: Allow port to override the allocator
.. espressif will be able to put the mp3 data in faster RAM this way.
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
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
J. Neuschäfer
7b050b366b py/nlrthumb: Make non-Thumb2 long-jump workaround opt-in.
Although the original motivation given for the workaround[1] is correct,
nlr.o and nlrthumb.o are linked with a small enough distance that the
problem does not occur, and the workaround isn't necessary. The distance
between the b instruction and its target (nlr_push_tail) is just 64
bytes[2], well within the ±2046 byte range addressable by an
unconditional branch instruction in Thumb mode.

The workaround induces a relocation in the text section (textrel), which
isn't supported everywhere, notably not on musl-libc[3], where it causes
a crash on start-up. With the workaround removed, micropython works on an
ARMv5T Linux system built with musl-libc.

This commit changes nlrthumb.c to use a direct jump by default, but
leaves the long jump workaround as an option for those cases where it's
actually needed.

[1]: commit dd376a239d

Author: Damien George <damien.p.george@gmail.com>
Date:   Fri Sep 1 15:25:29 2017 +1000

    py/nlrthumb: Get working again on standard Thumb arch (ie not Thumb2).

    "b" on Thumb might not be long enough for the jump to nlr_push_tail so
    it must be done indirectly.

[2]: Excerpt from objdump -d micropython:

000095c4 <nlr_push_tail>:
    95c4:       b510            push    {r4, lr}
    95c6:       0004            movs    r4, r0
    95c8:       f02d fd42       bl      37050 <mp_thread_get_state>
    95cc:       6943            ldr     r3, [r0, #20]
    95ce:       6023            str     r3, [r4, #0]
    95d0:       6144            str     r4, [r0, #20]
    95d2:       2000            movs    r0, #0
    95d4:       bd10            pop     {r4, pc}

000095d6 <nlr_pop>:
    95d6:       b510            push    {r4, lr}
    95d8:       f02d fd3a       bl      37050 <mp_thread_get_state>
    95dc:       6943            ldr     r3, [r0, #20]
    95de:       681b            ldr     r3, [r3, #0]
    95e0:       6143            str     r3, [r0, #20]
    95e2:       bd10            pop     {r4, pc}

000095e4 <nlr_push>:
    95e4:       60c4            str     r4, [r0, #12]
    95e6:       6105            str     r5, [r0, #16]
    95e8:       6146            str     r6, [r0, #20]
    95ea:       6187            str     r7, [r0, #24]
    95ec:       4641            mov     r1, r8
    95ee:       61c1            str     r1, [r0, #28]
    95f0:       4649            mov     r1, r9
    95f2:       6201            str     r1, [r0, #32]
    95f4:       4651            mov     r1, sl
    95f6:       6241            str     r1, [r0, #36]   @ 0x24
    95f8:       4659            mov     r1, fp
    95fa:       6281            str     r1, [r0, #40]   @ 0x28
    95fc:       4669            mov     r1, sp
    95fe:       62c1            str     r1, [r0, #44]   @ 0x2c
    9600:       4671            mov     r1, lr
    9602:       6081            str     r1, [r0, #8]
    9604:       e7de            b.n     95c4 <nlr_push_tail>

[3]: https://www.openwall.com/lists/musl/2020/09/25/4

Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
2024-04-25 16:06:28 +10: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
Angus Gratton
4bed614e70 py/objarray: Fix use-after-free if extending a bytearray from itself.
Two cases, one assigning to a slice.
Closes https://github.com/micropython/micropython/issues/13283

Second is extending a slice from itself, similar logic.

In both cases the problem occurs when m_renew causes realloc to move the
buffer, leaving a dangling pointer behind.

There are more complex and hard to fix cases when either argument is a
memoryview into the buffer, currently resizing to a new address breaks
memoryviews into that object.

Reproducing this bug and confirming the fix was done by running the unix
port under valgrind with GC-aware extensions.

Note in default configurations with GIL this bug exists but has no impact
(the free buffer won't be reused while the function is still executing, and
is no longer referenced after it returns).

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-04-22 11:50:52 +10:00
Vonasmic
ce491ab0d1 py/obj: Fix initialiser order in MP_DEFINE_CONST_OBJ_TYPE_NARGS_ macros.
This commit swaps the order of the `flags` and `name` struct initialisers
for `mp_obj_type_t`, to fix an incompatibility with C++.  The original
order of the initialiser didn't match the definition of the type, and
although that's still legal C, it's not legal C++.

Signed-off-by: Vonasmic <kasarkal123@gmail.com>
2024-04-22 11:10:23 +10:00
stijn
40f7e9ce20 py/objfun: Fix C++ compatibility with casting in inline functions.
Explicit casts are needed.

Fixes recent changes from 648a7578da and
9400229766.

Signed-off-by: stijn <stijn@ignitron.net>
2024-04-22 10:34:01 +10:00
Dan Halbert
00a18fe2c9 Adafruit Pixel Trinkey M0 2024-04-18 12:45:53 -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
Dan Halbert
05252146ec Turn on bitmapfilter with the same criteria as bitmaptools 2024-04-08 10:43:05 -04:00
Scott Shawcroft
fbd9a6e410
Merge pull request #9141 from dhalbert/serial_bytes_available
Runtime.serial_bytes_available: return count instead of bool
2024-04-05 10:20:02 -07:00
Scott Shawcroft
680ee119b5
Merge pull request #9135 from jepler/update-adafruit-floppy
Update floppyio to use newer adafruit_floppy, implement pio-based flux capture on rp2040
2024-04-04 09:56:51 -07:00
Dan Halbert
bb9968215c Runtime.serial_bytes_available: return count isntead of bool 2024-04-04 12:26:06 -04:00
9efb034cba Add pio-based flux capturing for rp2040 2024-04-02 15:42:28 -05:00
Mario Pesch
7b9e9d56fd add exception tag to build flags 2024-04-02 14:22:22 +00:00
Damien George
bdbc869f9e py/persistentcode: Bump .mpy sub-version to 6.3.
This is required because the .mpy native ABI was changed by the
introduction of `mp_proto_fun_t`, see commits:
- 416465d81e
- 5e3006f117
- e2ff00e811

And three `mp_binary` functions were added to `mp_fun_table` in
commit d2276f0d41.

Signed-off-by: Damien George <damien@micropython.org>
2024-03-28 16:18:26 +11:00
Damien George
d2276f0d41 py/dynruntime: Add mp_binary_get_size/get_val_array/set_val_array.
These are needed to read/write array.array objects, which is useful in
native code to provide fast extensions that work with big arrays of data.

Signed-off-by: Damien George <damien@micropython.org>
2024-03-28 16:18:09 +11:00
Dan Halbert
e10b179114 Merge remote-tracking branch 'adafruit/9.0.x' into 9.0.x-to-main-2024-03-27 2024-03-27 11:49:32 -04:00