.. 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.
This commit makes sure that functions in usb.core.Device return as
soon as they raise a MicroPython exception rather than continuing
on with whatever code would normally run. This will hopefully help
to avoid things like dereferencing null pointers.
shared-module/usb/core/Device.c had several spots where it would
raise a MicroPython exception with a NULL argument. That made it
very difficult for CircuitPython code to attempt to recover from
fault conditions caused by quirky USB device behavior. This adds
short error strings to distinguish the different types of faults.
- Starts with @tannewt's changes.
- Make sure proper component is being compiled.
- Added `I2C.probe()` as a visible new method. This was a hidden common-hal method, but the C version of adafruit_bus_device could not use it because it needs to call probe via a Python method call. So make it visible. It's useful, and `I2C.scan()` could be phased out, since now `.scan()` can be implemented in Python with `.probe()`.
- set clock-stretching timeout on espressif to a minimum of 1 second. In all impls of busio.I2C()`, the timeout is ignored and is set to a fixed 1 second. @tannewt's new code was using the passed-in value, which was often too short.
To do:
- switch esp-camera to new-driver version. We have to use the same I2C driver everywhere.
- Check about I2CTarget.
Make busio.I2C use finalizers for reset instead of bulk reset. This
makes it easier to track and free the memory that the IDF allocates
internally for its "handle".