Commit graph

5682 commits

Author SHA1 Message Date
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
999a4acd9f py/objmodule.c: disable new displayio name warnings 2024-03-26 16:06:27 -04:00
Scott Shawcroft
f7945aa285
Disable warnings during REPL autocomplete
Print output muddies the serial output. Setting warnings to crash
could actual raise an exception.

Fixes #8981
2024-02-29 11:58:06 -08:00
Dan Halbert
3871899860 wip 2024-02-17 22:42:41 -05:00
Bill Sideris
a20d445310
Revert MICROPY_FULL_VERSION_INFO to MICROPY_BANNER_NAME_AND_VERSION 2024-02-16 20:53:39 +02:00
Bill Sideris
c7701709ef
Merge branch 'main' into sysvers 2024-02-16 20:15:20 +02:00
979c2b25b3 use MICROPY_BANNER_MACHINE to fix unix build error 2024-02-16 10:42:51 -06:00
b57c37cd34 espressif: Use mbedtls implementation of ssl module.
the mbedtls version is a bit different so there are some new #ifdefs
needed.

Tested with the ssl test from https://github.com/adafruit/circuitpython/issues/8910
on Adafruit MatrixPortal S3 (no pico w testing done)
2024-02-15 14:26:24 -06:00
9abe273afa mbedtls: move to shared-module
this enables the implementation to be shared among ports.
2024-02-15 13:30:09 -06:00
9f697edd51 Excuse float comparisons in this file 2024-02-13 17:00:52 -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
Scott Shawcroft
96be941d83
Merge pull request #8844 from dhalbert/terse-errors 2024-01-30 22:41:23 -08:00
Dan Halbert
25deb94fc2 py/objdict.c: fix keys() for dict subclasses 2024-01-27 15:29:58 -05:00
Dan Halbert
a71f19ba02 circuitpy_mpconfig.h: terse errors on non-full-builds 2024-01-26 13:09:20 -05: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
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
Scott Shawcroft
61ec3280d1
Optimize error messages 2024-01-19 21:31:58 -08:00
Bill Sideris
af249bc86a
Revert "Please the beast?"
This reverts commit a7e45014a5.
2024-01-17 23:36:13 +02:00
Bill Sideris
b4c982f83f
Change micropython string 2024-01-17 23:32:28 +02:00
Bill Sideris
a7e45014a5
Please the beast? 2024-01-17 23:29:49 +02:00
Bill Sideris
f4a6acd136
Change sys.version to return the whole port identification 2024-01-17 22:40:31 +02: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