Commit graph

5670 commits

Author SHA1 Message Date
586a355d43 fix a buffer size so a stress test passes 2024-07-30 16:24:35 +03:00
f25e3c8b84 Fix synth tests by setting posix port precision back to double
later I'll want to switch it to float & endorse the new results but
for now just do this.
2024-04-06 17:13:14 -05:00
b222dd2203 fix cmd_showbc test 2024-04-06 10:28:28 -05:00
efcad6457b Excuse float comparisons in this file 2024-02-09 08:45:04 -08:00
af8126b4ce WIP 2024-02-08 10:43:19 -08:00
5761e87f7b WIP 2024-02-08 10:09:19 -08:00
23f7fe6f90 WIP 2024-02-08 09:52:01 -08:00
74f6884cac WIP 2024-01-29 09:33:30 -06:00
a17d2ac0db WIP 2024-01-27 14:39:29 -06:00
Scott Shawcroft
474dae8479
Merge pull request #8699 from tannewt/ww_sd_card
Make SD cards available over web workflow
2024-01-25 10:51:37 -08:00
Scott Shawcroft
283aac23be
Fix subclassing dict
The get, set and del item methods didn't correctly lookup the value
from the parent native instance because the functions took the type
from the instance.

Fixes #8758
2024-01-23 15:39:57 -08:00
Scott Shawcroft
9538e0067b
Merge remote-tracking branch 'adafruit/main' into ww_sd_card 2024-01-22 17:14:06 -08:00
Scott Shawcroft
61ec3280d1
Optimize error messages 2024-01-19 21:31:58 -08:00
ec42e35ae7
enable bitmapfilter only on esp32s3 for now
we want it for memento, and maybe for qualia. we can add it elsewhere
later if we want
2024-01-11 14:42:55 -06:00
75be426377
Add "bitmapfilter"
bitmapfilter.morph is taken from openmv's imlib.

It is substantially faster than blur/sharpen implemented in ulab,
by up to 10x. It also avoids making many allocations.
2024-01-05 14:16:00 -06:00
1bc616cfb5
Merge pull request #8749 from jepler/mbedtls-hashlib
Share the implementation of hashlib across ports
2024-01-04 10:34:22 -06:00
Dan Halbert
035569d7fe recent MicroPython broke out binascii.crc32() 2023-12-29 11:32:04 -05:00
5d1b49516c
Enable io.IOBase so we can construct a RequestsStreamWrapper in Python code 2023-12-24 10:49:59 -06:00
5aa203f13e
Restore CIRCUITPY-CHANGEs for stream protocols
We mark all protocols with their type using MP_PROTO_IMPLEMENT,
and checking in mp_get_stream{,_raise}.

This was not turning up as a problem in tests until a (new, not yet
commited) change to jpegio caused a segfault because a type implementing
a different protocol was passed in to mp_get_stream.

By using 0 (instead of MP_QSTR_protocol_stream) as the marker for
objects implementing the standard micropython stream protocol, the
number of CIRCUITPY-CHANGEs is minimized.
2023-12-24 10:41:54 -06:00
51e3d5ecbf
Add a note about this makeqstrdata change 2023-12-24 10:41:54 -06:00
93dd2d5d46
Fix a typo that prevented setting CIRCUITPY_HASHLIB_MBEDTLS properly 2023-12-22 20:13:01 -06:00
3d61e63834
Don't bring in mbedtls if hashlib is off 2023-12-22 19:29:29 -06:00
080cc545b3
Share the implementation of hashlib across ports
.. many platforms can use mbedtls to implement hashlib.

Compile-tested with pico-w. Tested on feather rp2040 dvi.
2023-12-22 17:06:12 -06:00
40722741dd
makeqstrdata: ensure certain qstrs are as early as possible
Some qstrs like those representing binary ops such as __add__ must have
qstr numbers that fit in 8 bits. Replace the former ad-hoc method,
which sorted *other* dunder-identifiers early with a list of all
the qstrs that have this requirement.

Before this, the unix coverage build was failing when I added certain
qstrs like "<input>" for a codeop filename default value.
2023-12-14 17:19:26 -06:00
9477574dfc
Add codeop.compile_command
This function in standard Python is a building block for custom REPLs:
```python
from codeop import compile_command

print("Repl in (Circuit-)Python")
ns = {}

PS1="<<< "
PS2=",,, "
command = ""
while True:
    line = input(PS2 if command else PS1)
    if command:
        command = command + "\n" + line
    else:
        command = line
    try:
        if (code := compile_command(command)):
            command = ""
            exec(code, ns)
    except Exception as e:
        command = ""
        print(e)
```
2023-12-14 09:23:23 -06:00
Scott Shawcroft
ca1b680d27
Merge pull request #8696 from jepler/jpegdecoder
Jpegdecoder
2023-12-08 15:35:29 -08:00
21de0a7349
Enable jpegio almost anywhere we can 2023-12-08 14:42:24 -06:00
bd86b44848
Add JpegDecoder 2023-12-05 12:11:53 -06:00
1e37f57443
move RGBMATRIX block to be alphabetic 2023-12-05 10:42:41 -06:00
Bill Sideris
186fa35138
Enable compile on all ports. 2023-12-04 22:00:32 +02:00
Dan Halbert
ad0949dcf5
Merge pull request #8663 from jepler/disable-fortify-source
Unset D_FORTIFY_SOURCE globally
2023-11-28 15:55:06 -05:00
b54330a1c6
Update py/circuitpy_defns.mk
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2023-11-28 14:54:04 -06:00
Dan Halbert
1cfb894c50
Merge pull request #8655 from jepler/save-flash-share-utf8
Save flash by sharing the 'to utf-8' implementation
2023-11-28 10:47:41 -05:00
a14eb26d4b
Unset D_FORTIFY_SOURCE globally 2023-11-28 08:21:02 -06:00
3c8f9f4dab
py/modbuiltins: Share vstr_add_char's implementation of utf8 encoding.
This saves ~84 bytes on trinket m0, and saves 112 bytes on PYBV10.

Signed-off-by: Jeff Epler <jepler@gmail.com>
2023-11-28 07:56:03 -06:00
Dan Halbert
567c273e46 ESP32-S3 BLE: set up Characteristic properly during discovery 2023-11-21 20:53:05 -05:00
3a68d2f621
Fix build error when frozen modules are updated
When a frozen module was added or updated, a build error would occur
during CI: `KeyError: 'FROZEN_MPY_DIRS'`.

In e40abda1bc I decided that it should be an error if all the expected
keys were not defined in the board settings dict. I made this change
and all seemed to be well; however, my testing did not exercise the
case that a frozen module was changed.

It turns out that FROZEN_MPY_DIRS was not being set in the board settings
dict because the output of print-FROZEN_MPY_DIRS was "FROZEN_MPY_DIRS ="
(which does not match the regular expression) instead of
"FROZEN_MPY_DIRS = " (with a trailing space).

This change fixes the problem by ensuring that an undefined or empty
variable still prints with a space character after the equal character.

Tested by running locally:
```
python3 -c 'import shared_bindings_matrix; print(shared_bindings_matrix.get_settings_from_makefile("ports/atmel-samd", "trinket_m0")["FROZEN_MPY_DIRS"])'
```
(prints a blank line, expected)

as well as simulating a change to the asyncio frozen submodule:
```
python3 -c 'import shared_bindings_matrix; print(shared_bindings_matrix.get_settings_from_makefile("ports/atmel-samd", "trinket_m0")["FROZEN_MPY_DIRS"])'
```
(which will build the elecfreaks_picoed board)
2023-11-18 09:43:36 -06:00
Dan Halbert
58b111d428
Merge pull request #8608 from jepler/add-locale-module
Add `locale.getlocale()`
2023-11-15 09:24:04 -05:00
46bfbad1bb
Add locale.getlocale()
This returns the localization of the running CircuitPython, such as
en_US, fr, etc.

Additional changes are needed in build infrastructure since the
string "en_US" should not appear to be translated in weblate, ever;
instead the value comes from the translation metadata.

Closes: #8602
2023-11-14 21:20:03 -06:00
Scott Shawcroft
8ff0682937
Merge pull request #8605 from tannewt/fix_esp_heap_alloc
Fix split heap on ESP
2023-11-14 14:52:28 -08:00
Scott Shawcroft
1f2355742b
Fix split heap on ESP
It was setting the DMA capability requirement which excludes PSRAM.

Fixes #8597. Fixes #8573.
2023-11-14 12:00:59 -08:00
Scott Shawcroft
4bdd3e6150
Merge pull request #8589 from jepler/issue8588
Rework ci_fetch_deps and use it from makefiles too
2023-11-14 10:04:37 -08:00
fb840159fb
Remove some stuff about reserved psram & supervisor allocations
this is obsoleted by the new split heap code 🎉
2023-11-13 12:55:26 -06:00
6db9f2e73f
Rework ci_fetch_deps and use it from makefiles too
* teach ci_fetch_deps about --filter=blob:none
 * change logic ensuring tags in frozen/ are fetched
 * since check=True was all the time, remove unused kwarg
 * add fetch-board-submodules

Closes: #8588
2023-11-12 12:32:34 -06:00
Dan Halbert
191a5a31c7
add CIRCUITPY-CHANGE annotations 2023-11-08 09:08:10 -05:00
Scott Shawcroft
8137e2d6d2
Switch all ports to auto-growing split heap
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.
2023-11-01 15:24:16 -07:00
2296c85e29
fix another error seen only on clean builds 2023-10-30 16:25:25 +01:00
774f6ac6ab
Switch to using MP_ERROR_TEXT instead of translate, globally 2023-10-30 09:49:06 +01:00
Dan Halbert
32b6ac79d5
Merge pull request #8519 from jepler/compressed-message-type
Rename compressed_string_t to mp_rom_error_text_t to match upstream
2023-10-27 10:53:44 -04:00
Scott Shawcroft
cf08ef0b80
Enable warnings in full builds only 2023-10-26 13:43:04 -07:00