Commit graph

2765 commits

Author SHA1 Message Date
614eded02a getenv: Make os.getenv() show a better error
.. when an associated value is not a quoted string.
This includes some cases where it would previously return an
integer, a CPython incompatibility.

However, it's an incompatible behavior change with circuitpython
since previously a number would be returned.

Closes: #9113

Signed-off-by: Jeff Epler <jepler@gmail.com>
2025-06-14 18:57:28 +02:00
Dan Halbert
c87ba3658e Merge remote-tracking branch 'adafruit/9.2.x' into 9.2.x-merge-2025-05-28 2025-05-28 16:25:40 -04:00
Bernhard Bablok
cb1fcf3d50 fix deque implementation from upstream 2025-05-28 11:06:22 +02:00
gamblor21
ea358399aa Updated tests 2025-04-23 17:49:15 -05:00
Cooper Dalrymple
05a50b8fd8 Initial replacement of old Biquad with BlockBiquad 2025-04-01 09:10:25 -05:00
Dan Halbert
25216c88c7
Merge pull request #10195 from dhalbert/9.2.x
Merge 9.2.x to main
2025-03-28 17:22:20 -04:00
Dan Halbert
81d96aca10
Merge pull request #10185 from jepler/issue10175
mp3 samples are signed
2025-03-26 12:00:09 -04:00
17497e425f improve test
This test was written in such a way that having a wrong data type
for the mp3 samples wasn't detected. Instead of using
np.frombuffer(dtype=int16), just do arithmetic directly on the
samples. During testing time we don't care if it might be a little
slower or use a little more RAM than ulab, and we don't care
whether it's actually an RMS calculation.  Just that it's
consistent and shows the audio data is correct, including its
defined data type.
2025-03-26 10:17:26 -05:00
foamyguy
8afdccc2cf check if pins exist before using 2025-03-19 15:59:32 -05:00
foamyguy
aae26fb1db add set_configuration() to fix existing basic_mouse demo, add new displayio_mouse demo. 2025-03-10 20:13:06 -05:00
6054810f58 Fix filters again 2025-02-07 21:06:09 -06:00
8b20c841f7 Audiofilter: Add support for block biquads
& test by filtering some noise with a pair of BlockBiquads
2025-02-07 20:59:48 -06:00
Scott Shawcroft
e277540f7a
Switch to ruff like MicroPython 2025-02-05 11:09:15 -08:00
Dan Halbert
8a3b1d55a9 update asyncio_micropython test due to adafruit_ticks change 2025-01-28 13:04:01 -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
22abf2df02 MP3Decoder: clear out DSP data when opening a new stream
The new test verifies that the first part of an MP3 decodes as
expected even when the "open" method is used.

Closes: #9705
2024-12-04 13:55:09 -06:00
Hurst, Brandon
ff87a70f9c Updated USB PID for max32690evkit 2024-11-25 15:28:41 -08: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
c06e6ee03e BlockBiquad: Use Q as argument name
Synthesizer.lpf takes `Q` as the argument name, use the same convention
here.
2024-11-07 13:59:23 -06:00
f8afdcb729 Add audiodelays & audioeffects to unix coverage port
.. and add a very basic audioeffects test, showing that it plausibly
is working

I had to address several build errors that occurred in the Unix build,
mostly related to conversion from FP types to integral types (replaced
by explicit casts) and by
accidental mixing of regular & f-suffixed floating constants (replaced
with the MICROPY_FLOAT_CONST macro)

Particularly this change could use consideration:
```diff
-    self->max_echo_buffer_len = self->sample_rate / 1000.0f * max_delay_ms * (self->channel_count * sizeof(uint16_t)); // bytes
+    self->max_echo_buffer_len = (uint32_t)(self->sample_rate / 1000.0f * max_delay_ms) * (self->channel_count * sizeof(uint16_t)); // bytes
```

The buffer length is being calculated in floating point based on the
millisecond delay & the sample rate. The result could then be a fractional
number such as 529.2 for a 12ms delay at 44.1kHz. Multiplying a floating
number by the size required for each echo buffer item
(`(self->channel_count * sizeof(uint16_t))`) could yield a number of bytes
that doesn't correspond to an integral number of buffer items. I grouped
the float->int conversion so that it converts the number of echo buffer
items to an integer and then multiplies by the size of the item.
2024-11-05 09:36:18 -06:00
f7f471f9de
Merge pull request #9788 from dcooperdalrymple/synthio_waveform_loop_blockinput 2024-11-04 15:11:40 -06:00
dcooperdalrymple
fd24006901 Updated expected results for synthesizer_note test. 2024-11-04 13:33:16 -06:00
a3d7eb6b04 fix tests & add expected results 2024-11-04 12:05:55 -06:00
53bd93c8f6 Add basic block biquad test 2024-11-04 09:56:36 -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
21ebcad778 Add notch filter to BlockBiquad 2024-10-24 21:02:40 -05:00
e891bce129 Rename FilterType -> FilterMode 2024-10-24 20:53:31 -05:00
ce0c1c77a4 Add BlockBiquad
BlockBiquad takes kind, f0 (center frequency) & Q (sharpness)
block type arguments and calculates the actual filter coefficients
every frame.

This allows the filter characteristics f0 and Q to be changed dynamically
from LFOs & arithmetic blocks.

A new manual test demonstrates this on a host computer, playing a simple
tone that is dynamically filtered.
2024-10-24 11:39:23 -05:00
71eea30639 keep PYTHONPATH when requested
This turns out to be needed by the testsuite of jepler_udecimal, which
needs to add the `jepler_udecimal` directory both to PYTHONPATH and
MICROPYPATH.
2024-09-23 21:02:08 -05:00
Dan Halbert
c0a3e28079 tests/run-natmodtests.py: remove use of zlib examples 2024-09-13 09:26:54 -04:00
Dan Halbert
50f01014b4 revert to using os.mount, etc. instead of vfs.mount 2024-09-10 18:23:39 -04:00
Dan Halbert
483268314b restore tests/unix; deleted by mistake 2024-09-10 17:57:27 -04:00
Dan Halbert
1f68fffa13 merge from main 2024-09-10 16:36:32 -04:00
Dan Halbert
0c26a114a4 fix tests; asyncio: avoid coroutine never awaited 2024-09-10 16:05:21 -04:00
Dan Halbert
02e11a9413 fix compilation issues; remove more uctypes mentions 2024-09-10 16:04:47 -04:00
Dan Halbert
7812695281 non-conflict merge changes 2024-09-05 14:54:18 -04:00
timdechant
da581102f6 shared/runtime/sys_stdio_mphal: Fix docstring for stdio.
Signed-off-by: timdechant <timdechant.git@gmail.com>
2024-09-03 22:48:53 -04:00
timdechant
319fb89d31 shared/runtime/sys_stdio_mphal: Fix docstring for stdio.
Signed-off-by: timdechant <timdechant.git@gmail.com>
2024-09-03 22:48:33 -04:00
timdechant
67c8b07343 shared/runtime/sys_stdio_mphal: Fix docstring for stdio.
Signed-off-by: timdechant <timdechant.git@gmail.com>
2024-09-03 22:47:19 -04:00
timdechant
8b873b65ac shared/runtime/sys_stdio_mphal: Fix docstring for stdio.
Signed-off-by: timdechant <timdechant.git@gmail.com>
2024-09-03 22:47:05 -04:00
timdechant
c6c4c79330 shared/runtime/sys_stdio_mphal: Fix docstring for stdio.
Signed-off-by: timdechant <timdechant.git@gmail.com>
2024-09-03 22:41:34 -04:00
Dan Halbert
ac7e15f88a (only) reserve merge conflicts 2024-08-28 16:31:37 -04:00
Dan Halbert
b94815ccc8 tests/extmod/select_poll_fd.py: disable fd limit test 2024-08-20 21:22:10 -04:00
Dan Halbert
342f7a9daa tests/micropython/import_mpy_native_gc.py: update native .mpy 2024-08-19 13:04:06 -04:00
Dan Halbert
29216d7485 asyncio update; set fd max in test 2024-08-17 12:22:03 -04:00
Dan Halbert
4d72d6ad25 update asyncio library and fix tests 2024-08-16 23:46:29 -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
Dan Halbert
be6fa2af21 merge from main 2024-07-29 17:41:46 -04:00