From a405019d5506d15d31c8f731ef6fb6ef1f562cf6 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 1 Mar 2025 11:43:26 -0600 Subject: [PATCH 01/24] Initial commit --- locale/circuitpython.pot | 9 + py/circuitpy_defns.mk | 1 + shared-bindings/audiodelays/Reverb.c | 218 +++++++++++++++++++++++++ shared-bindings/audiodelays/Reverb.h | 26 +++ shared-bindings/audiodelays/__init__.c | 3 + shared-module/audiodelays/Reverb.c | 188 +++++++++++++++++++++ shared-module/audiodelays/Reverb.h | 40 +++++ 7 files changed, 485 insertions(+) create mode 100644 shared-bindings/audiodelays/Reverb.c create mode 100644 shared-bindings/audiodelays/Reverb.h create mode 100644 shared-module/audiodelays/Reverb.c create mode 100644 shared-module/audiodelays/Reverb.h diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 167fb20ff9e80..d9e46ad13e522 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -2575,6 +2575,11 @@ msgstr "" #: shared-bindings/audiodelays/Echo.c shared-bindings/audiodelays/PitchShift.c #: shared-bindings/audiofilters/Distortion.c +#: shared-bindings/audiodelays/Reverb.c +msgid "bits_per_sample must be 16" +msgstr "" + +#: shared-bindings/audiodelays/Echo.c shared-bindings/audiofilters/Distortion.c #: shared-bindings/audiofilters/Filter.c shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -3992,6 +3997,10 @@ msgstr "" msgid "rsplit(None,n)" msgstr "" +#: shared-bindings/audiodelays/Reverb.c +msgid "samples_signed must be true" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 513f7d2d64d97..150a5eb5a537b 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -633,6 +633,7 @@ SRC_SHARED_MODULE_ALL = \ audiocore/__init__.c \ audiodelays/Echo.c \ audiodelays/PitchShift.c \ + audiodelays/Reverb.c \ audiodelays/__init__.c \ audiofilters/Distortion.c \ audiofilters/Filter.c \ diff --git a/shared-bindings/audiodelays/Reverb.c b/shared-bindings/audiodelays/Reverb.c new file mode 100644 index 0000000000000..e773fca58dbf1 --- /dev/null +++ b/shared-bindings/audiodelays/Reverb.c @@ -0,0 +1,218 @@ +// This file is part of the CircuitPython project: https://circuitpython.org +// +// SPDX-FileCopyrightText: Copyright (c) 2024 Mark Komus +// +// SPDX-License-Identifier: MIT + +#include + +#include "shared-bindings/audiodelays/Reverb.h" +#include "shared-bindings/audiocore/__init__.h" +#include "shared-module/audiodelays/Reverb.h" + +#include "shared/runtime/context_manager_helpers.h" +#include "py/binary.h" +#include "py/objproperty.h" +#include "py/runtime.h" +#include "shared-bindings/util.h" +#include "shared-module/synthio/block.h" + +#define DECAY_DEFAULT 0.7f +#define MIX_DEFAULT 0.5f + +//| class Reverb: +//| """An Reverb effect""" +//| +//| def __init__( +//| self, +//| max_delay_ms: int = 500, +//| delay_ms: synthio.BlockInput = 250.0, +//| decay: synthio.BlockInput = 0.7, +//| mix: synthio.BlockInput = 0.5, +//| buffer_size: int = 512, +//| sample_rate: int = 8000, +//| bits_per_sample: int = 16, +//| samples_signed: bool = True, +//| channel_count: int = 1, +//| ) -> None: +//| """Create a Reverb effect where you hear the original sample play back, at a lesser volume after +//| a set number of millisecond delay. The delay timing of the reverb can be changed at runtime +//| with the delay_ms parameter but the delay can never exceed the max_delay_ms parameter. The +//| maximum delay you can set is limited by available memory. +//| +//| Each time the reverb plays back the volume is reduced by the decay setting (reverb * decay). +//| +//| The mix parameter allows you to change how much of the unchanged sample passes through to +//| the output to how much of the effect audio you hear as the output. +//| +//| :param int max_delay_ms: The maximum time the reverb can be in milliseconds +//| :param synthio.BlockInput delay_ms: The current time of the reverb delay in milliseconds. Must be less the max_delay_ms +//| :param synthio.BlockInput decay: The rate the reverb fades. 0.0 = instant; 1.0 = never. +//| :param synthio.BlockInput mix: The mix as a ratio of the sample (0.0) to the effect (1.0). +//| :param int buffer_size: The total size in bytes of each of the two playback buffers to use +//| :param int sample_rate: The sample rate to be used +//| :param int channel_count: The number of channels the source samples contain. 1 = mono; 2 = stereo. +//| :param int bits_per_sample: The bits per sample of the effect +//| :param bool samples_signed: Effect is signed (True) or unsigned (False) +//| :param bool freq_shift: Do reverbs change frequency as the reverb delay changes +//| +//| Playing adding an reverb to a synth:: +//| +//| import time +//| import board +//| import audiobusio +//| import synthio +//| import audiodelays +//| +//| audio = audiobusio.I2SOut(bit_clock=board.GP20, word_select=board.GP21, data=board.GP22) +//| synth = synthio.Synthesizer(channel_count=1, sample_rate=44100) +//| reverb = audiodelays.Reverb(max_delay_ms=1000, delay_ms=850, decay=0.65, buffer_size=1024, channel_count=1, sample_rate=44100, mix=0.7, freq_shift=False) +//| reverb.play(synth) +//| audio.play(reverb) +//| +//| note = synthio.Note(261) +//| while True: +//| synth.press(note) +//| time.sleep(0.25) +//| synth.release(note) +//| time.sleep(5)""" +//| ... +//| +static mp_obj_t audiodelays_reverb_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { + enum { ARG_buffer_size, ARG_sample_rate, ARG_bits_per_sample, ARG_samples_signed, ARG_channel_count, ARG_freq_shift, }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_buffer_size, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 512} }, + { MP_QSTR_sample_rate, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 8000} }, + { MP_QSTR_bits_per_sample, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 16} }, + { MP_QSTR_samples_signed, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, + { MP_QSTR_channel_count, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 1 } }, + { MP_QSTR_freq_shift, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true } }, + }; + + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + mp_int_t channel_count = mp_arg_validate_int_range(args[ARG_channel_count].u_int, 1, 2, MP_QSTR_channel_count); + mp_int_t sample_rate = mp_arg_validate_int_min(args[ARG_sample_rate].u_int, 1, MP_QSTR_sample_rate); + if (args[ARG_samples_signed].u_bool != true) { + mp_raise_ValueError(MP_ERROR_TEXT("samples_signed must be true")); + } + mp_int_t bits_per_sample = args[ARG_bits_per_sample].u_int; + if (bits_per_sample != 16) { + mp_raise_ValueError(MP_ERROR_TEXT("bits_per_sample must be 16")); + } + + audiodelays_reverb_obj_t *self = mp_obj_malloc(audiodelays_reverb_obj_t, &audiodelays_reverb_type); + common_hal_audiodelays_reverb_construct(self, args[ARG_buffer_size].u_int, bits_per_sample, args[ARG_samples_signed].u_bool, channel_count, sample_rate, args[ARG_freq_shift].u_bool); + + return MP_OBJ_FROM_PTR(self); +} + +//| def deinit(self) -> None: +//| """Deinitialises the Reverb.""" +//| ... +//| +static mp_obj_t audiodelays_reverb_deinit(mp_obj_t self_in) { + audiodelays_reverb_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_audiodelays_reverb_deinit(self); + return mp_const_none; +} +static MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_reverb_deinit_obj, audiodelays_reverb_deinit); + +static void check_for_deinit(audiodelays_reverb_obj_t *self) { + audiosample_check_for_deinit(&self->base); +} + +//| def __enter__(self) -> Reverb: +//| """No-op used by Context Managers.""" +//| ... +//| +// Provided by context manager helper. + +//| def __exit__(self) -> None: +//| """Automatically deinitializes when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +//| +// Provided by context manager helper. + +//| playing: bool +//| """True when the effect is playing a sample. (read-only)""" +//| +static mp_obj_t audiodelays_reverb_obj_get_playing(mp_obj_t self_in) { + audiodelays_reverb_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_bool(common_hal_audiodelays_reverb_get_playing(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_reverb_get_playing_obj, audiodelays_reverb_obj_get_playing); + +MP_PROPERTY_GETTER(audiodelays_reverb_playing_obj, + (mp_obj_t)&audiodelays_reverb_get_playing_obj); + +//| def play(self, sample: circuitpython_typing.AudioSample, *, loop: bool = False) -> None: +//| """Plays the sample once when loop=False and continuously when loop=True. +//| Does not block. Use `playing` to block. +//| +//| The sample must match the encoding settings given in the constructor.""" +//| ... +//| +static mp_obj_t audiodelays_reverb_obj_play(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_sample, ARG_loop }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_sample, MP_ARG_OBJ | MP_ARG_REQUIRED, {} }, + { MP_QSTR_loop, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, + }; + audiodelays_reverb_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + check_for_deinit(self); + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + + mp_obj_t sample = args[ARG_sample].u_obj; + common_hal_audiodelays_reverb_play(self, sample, args[ARG_loop].u_bool); + + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_KW(audiodelays_reverb_play_obj, 1, audiodelays_reverb_obj_play); + +//| def stop(self) -> None: +//| """Stops playback of the sample. The reverb continues playing.""" +//| ... +//| +//| +static mp_obj_t audiodelays_reverb_obj_stop(mp_obj_t self_in) { + audiodelays_reverb_obj_t *self = MP_OBJ_TO_PTR(self_in); + + common_hal_audiodelays_reverb_stop(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_reverb_stop_obj, audiodelays_reverb_obj_stop); + +static const mp_rom_map_elem_t audiodelays_reverb_locals_dict_table[] = { + // Methods + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&audiodelays_reverb_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&default___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR_play), MP_ROM_PTR(&audiodelays_reverb_play_obj) }, + { MP_ROM_QSTR(MP_QSTR_stop), MP_ROM_PTR(&audiodelays_reverb_stop_obj) }, + + // Properties + { MP_ROM_QSTR(MP_QSTR_playing), MP_ROM_PTR(&audiodelays_reverb_playing_obj) }, + AUDIOSAMPLE_FIELDS, +}; +static MP_DEFINE_CONST_DICT(audiodelays_reverb_locals_dict, audiodelays_reverb_locals_dict_table); + +static const audiosample_p_t audiodelays_reverb_proto = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_audiosample) + .reset_buffer = (audiosample_reset_buffer_fun)audiodelays_reverb_reset_buffer, + .get_buffer = (audiosample_get_buffer_fun)audiodelays_reverb_get_buffer, +}; + +MP_DEFINE_CONST_OBJ_TYPE( + audiodelays_reverb_type, + MP_QSTR_Reverb, + MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS, + make_new, audiodelays_reverb_make_new, + locals_dict, &audiodelays_reverb_locals_dict, + protocol, &audiodelays_reverb_proto + ); diff --git a/shared-bindings/audiodelays/Reverb.h b/shared-bindings/audiodelays/Reverb.h new file mode 100644 index 0000000000000..3b16d34243376 --- /dev/null +++ b/shared-bindings/audiodelays/Reverb.h @@ -0,0 +1,26 @@ +// This file is part of the CircuitPython project: https://circuitpython.org +// +// SPDX-FileCopyrightText: Copyright (c) 2024 Mark Komus +// +// SPDX-License-Identifier: MIT + +#pragma once + +#include "shared-module/audiodelays/Reverb.h" + +extern const mp_obj_type_t audiodelays_reverb_type; + +void common_hal_audiodelays_reverb_construct(audiodelays_reverb_obj_t *self, + uint32_t buffer_size, uint8_t bits_per_sample, bool samples_signed, + uint8_t channel_count, uint32_t sample_rate, bool freq_shift); + +void common_hal_audiodelays_reverb_deinit(audiodelays_reverb_obj_t *self); +bool common_hal_audiodelays_reverb_deinited(audiodelays_reverb_obj_t *self); + +uint32_t common_hal_audiodelays_reverb_get_sample_rate(audiodelays_reverb_obj_t *self); +uint8_t common_hal_audiodelays_reverb_get_channel_count(audiodelays_reverb_obj_t *self); +uint8_t common_hal_audiodelays_reverb_get_bits_per_sample(audiodelays_reverb_obj_t *self); + +bool common_hal_audiodelays_reverb_get_playing(audiodelays_reverb_obj_t *self); +void common_hal_audiodelays_reverb_play(audiodelays_reverb_obj_t *self, mp_obj_t sample, bool loop); +void common_hal_audiodelays_reverb_stop(audiodelays_reverb_obj_t *self); diff --git a/shared-bindings/audiodelays/__init__.c b/shared-bindings/audiodelays/__init__.c index 58cb9dc70a879..3c20661e2fe30 100644 --- a/shared-bindings/audiodelays/__init__.c +++ b/shared-bindings/audiodelays/__init__.c @@ -12,6 +12,8 @@ #include "shared-bindings/audiodelays/__init__.h" #include "shared-bindings/audiodelays/Echo.h" #include "shared-bindings/audiodelays/PitchShift.h" +#include "shared-bindings/audiodelays/Reverb.h" + //| """Support for audio delay effects //| @@ -23,6 +25,7 @@ static const mp_rom_map_elem_t audiodelays_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_audiodelays) }, { MP_ROM_QSTR(MP_QSTR_Echo), MP_ROM_PTR(&audiodelays_echo_type) }, { MP_ROM_QSTR(MP_QSTR_PitchShift), MP_ROM_PTR(&audiodelays_pitch_shift_type) }, + { MP_ROM_QSTR(MP_QSTR_Reverb), MP_ROM_PTR(&audiodelays_reverb_type) }, }; static MP_DEFINE_CONST_DICT(audiodelays_module_globals, audiodelays_module_globals_table); diff --git a/shared-module/audiodelays/Reverb.c b/shared-module/audiodelays/Reverb.c new file mode 100644 index 0000000000000..872655a3e0962 --- /dev/null +++ b/shared-module/audiodelays/Reverb.c @@ -0,0 +1,188 @@ +// This file is part of the CircuitPython project: https://circuitpython.org +// +// SPDX-FileCopyrightText: Copyright (c) 2025 Mark Komus +// +// SPDX-License-Identifier: MIT +#include "shared-bindings/audiodelays/Reverb.h" + +#include +#include "py/runtime.h" +#include + +void common_hal_audiodelays_reverb_construct(audiodelays_reverb_obj_t *self, + uint32_t buffer_size, uint8_t bits_per_sample, + bool samples_signed, uint8_t channel_count, uint32_t sample_rate, bool freq_shift) { + + // Basic settings every effect and audio sample has + // These are the effects values, not the source sample(s) + self->base.bits_per_sample = bits_per_sample; // Most common is 16, but 8 is also supported in many places + self->base.samples_signed = samples_signed; // Are the samples we provide signed (common is true) + self->base.channel_count = channel_count; // Channels can be 1 for mono or 2 for stereo + self->base.sample_rate = sample_rate; // Sample rate for the effect, this generally needs to match all audio objects + self->base.single_buffer = false; + self->base.max_buffer_length = buffer_size; + + // To smooth things out as CircuitPython is doing other tasks most audio objects have a buffer + // A double buffer is set up here so the audio output can use DMA on buffer 1 while we + // write to and create buffer 2. + // This buffer is what is passed to the audio component that plays the effect. + // Samples are set sequentially. For stereo audio they are passed L/R/L/R/... + self->buffer_len = buffer_size; // in bytes + + self->buffer[0] = m_malloc(self->buffer_len); + if (self->buffer[0] == NULL) { + common_hal_audiodelays_reverb_deinit(self); + m_malloc_fail(self->buffer_len); + } + memset(self->buffer[0], 0, self->buffer_len); + + self->buffer[1] = m_malloc(self->buffer_len); + if (self->buffer[1] == NULL) { + common_hal_audiodelays_reverb_deinit(self); + m_malloc_fail(self->buffer_len); + } + memset(self->buffer[1], 0, self->buffer_len); + + self->last_buf_idx = 1; // Which buffer to use first, toggle between 0 and 1 + + // Initialize other values most effects will need. + self->sample = NULL; // The current playing sample + self->sample_remaining_buffer = NULL; // Pointer to the start of the sample buffer we have not played + self->sample_buffer_length = 0; // How many samples do we have left to play (these may be 16 bit!) + self->loop = false; // When the sample is done do we loop to the start again or stop (e.g. in a wav file) + self->more_data = false; // Is there still more data to read from the sample or did we finish + + // The below section sets up the reverb effect's starting values. For a different effect this section will change +} + +bool common_hal_audiodelays_reverb_deinited(audiodelays_reverb_obj_t *self) { + if (self->buffer[0] == NULL) { + return true; + } + return false; +} + +void common_hal_audiodelays_reverb_deinit(audiodelays_reverb_obj_t *self) { + if (common_hal_audiodelays_reverb_deinited(self)) { + return; + } + self->buffer[0] = NULL; + self->buffer[1] = NULL; +} + +void audiodelays_reverb_reset_buffer(audiodelays_reverb_obj_t *self, + bool single_channel_output, + uint8_t channel) { + + memset(self->buffer[0], 0, self->buffer_len); + memset(self->buffer[1], 0, self->buffer_len); +} + +bool common_hal_audiodelays_reverb_get_playing(audiodelays_reverb_obj_t *self) { + return self->sample != NULL; +} + +void common_hal_audiodelays_reverb_play(audiodelays_reverb_obj_t *self, mp_obj_t sample, bool loop) { + audiosample_must_match(&self->base, sample); + + self->sample = sample; + self->loop = loop; + + audiosample_reset_buffer(self->sample, false, 0); + audioio_get_buffer_result_t result = audiosample_get_buffer(self->sample, false, 0, (uint8_t **)&self->sample_remaining_buffer, &self->sample_buffer_length); + + // Track remaining sample length in terms of bytes per sample + self->sample_buffer_length /= (self->base.bits_per_sample / 8); + // Store if we have more data in the sample to retrieve + self->more_data = result == GET_BUFFER_MORE_DATA; + + return; +} + +void common_hal_audiodelays_reverb_stop(audiodelays_reverb_obj_t *self) { + // When the sample is set to stop playing do any cleanup here + // For reverb we clear the sample but the reverb continues until the object reading our effect stops + self->sample = NULL; + return; +} + +audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj_t *self, bool single_channel_output, uint8_t channel, + uint8_t **buffer, uint32_t *buffer_length) { + + if (!single_channel_output) { + channel = 0; + } + + // Switch our buffers to the other buffer + self->last_buf_idx = !self->last_buf_idx; + + // 16 bit samples we need a 16 bit pointer + int16_t *word_buffer = (int16_t *)self->buffer[self->last_buf_idx]; + uint32_t length = self->buffer_len / (self->base.bits_per_sample / 8); + + // Loop over the entire length of our buffer to fill it, this may require several calls to get data from the sample + while (length != 0) { + // Check if there is no more sample to play, we will either load more data, reset the sample if loop is on or clear the sample + if (self->sample_buffer_length == 0) { + if (!self->more_data) { // The sample has indicated it has no more data to play + if (self->loop && self->sample) { // If we are supposed to loop reset the sample to the start + audiosample_reset_buffer(self->sample, false, 0); + } else { // If we were not supposed to loop the sample, stop playing it but we still need to play the reverb + self->sample = NULL; + } + } + if (self->sample) { + // Load another sample buffer to play + audioio_get_buffer_result_t result = audiosample_get_buffer(self->sample, false, 0, (uint8_t **)&self->sample_remaining_buffer, &self->sample_buffer_length); + // Track length in terms of words. + self->sample_buffer_length /= (self->base.bits_per_sample / 8); + self->more_data = result == GET_BUFFER_MORE_DATA; + } + } + + // Determine how many bytes we can process to our buffer, the less of the sample we have left and our buffer remaining + uint32_t n; + if (self->sample == NULL) { + n = MIN(length, SYNTHIO_MAX_DUR * self->base.channel_count); + } else { + n = MIN(MIN(self->sample_buffer_length, length), SYNTHIO_MAX_DUR * self->base.channel_count); + } + + // get the effect values we need from the BlockInput. These may change at run time so you need to do bounds checking if required + shared_bindings_synthio_lfo_tick(self->base.sample_rate, n / self->base.channel_count); + + // If we have no sample keep the reverb reverbing + if (self->sample == NULL) { + // Since we have no sample we can just iterate over the our entire remaining buffer and finish + for (uint32_t i = 0; i < n; i++) { + int16_t word = 0; + word_buffer[i] = word; + } + } else { + // we have a sample to play + int16_t *sample_src = (int16_t *)self->sample_remaining_buffer; + + for (uint32_t i = 0; i < n; i++) { + int32_t sample_word = sample_src[i]; + + int32_t word; + word = synthio_mix_down_sample(sample_word, SYNTHIO_MIX_DOWN_SCALE(2)); + + word_buffer[i] = (int16_t)word; + } + + // Update the remaining length and the buffer positions based on how much we wrote into our buffer + length -= n; + word_buffer += n; + self->sample_remaining_buffer += (n * (self->base.bits_per_sample / 8)); + self->sample_buffer_length -= n; + } + } + + // Finally pass our buffer and length to the calling audio function + *buffer = (uint8_t *)self->buffer[self->last_buf_idx]; + *buffer_length = self->buffer_len; + + // Reverb always returns more data but some effects may return GET_BUFFER_DONE or GET_BUFFER_ERROR (see audiocore/__init__.h) + return GET_BUFFER_MORE_DATA; +} diff --git a/shared-module/audiodelays/Reverb.h b/shared-module/audiodelays/Reverb.h new file mode 100644 index 0000000000000..300ac0a97904a --- /dev/null +++ b/shared-module/audiodelays/Reverb.h @@ -0,0 +1,40 @@ +// This file is part of the CircuitPython project: https://circuitpython.org +// +// SPDX-FileCopyrightText: Copyright (c) 2025 Mark Komus +// +// SPDX-License-Identifier: MIT +#pragma once + +#include "py/obj.h" + +#include "shared-module/audiocore/__init__.h" +#include "shared-module/synthio/__init__.h" +#include "shared-module/synthio/block.h" + +extern const mp_obj_type_t audiodelays_reverb_type; + +typedef struct { + audiosample_base_t base; + + int8_t *buffer[2]; + uint8_t last_buf_idx; + uint32_t buffer_len; // max buffer in bytes + + uint8_t *sample_remaining_buffer; + uint32_t sample_buffer_length; + + bool loop; + bool more_data; + + mp_obj_t sample; +} audiodelays_reverb_obj_t; + +void audiodelays_reverb_reset_buffer(audiodelays_reverb_obj_t *self, + bool single_channel_output, + uint8_t channel); + +audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj_t *self, + bool single_channel_output, + uint8_t channel, + uint8_t **buffer, + uint32_t *buffer_length); // length in bytes From aba78f9d45cf4c78aeadd3ab001cd5e689c2aa37 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 22 Mar 2025 10:57:33 -0500 Subject: [PATCH 02/24] Initial buffers --- shared-bindings/audiodelays/Reverb.c | 65 ++++++++++- shared-bindings/audiodelays/Reverb.h | 12 +- shared-module/audiodelays/Reverb.c | 162 ++++++++++++++++++++++++++- shared-module/audiodelays/Reverb.h | 15 +++ 4 files changed, 246 insertions(+), 8 deletions(-) diff --git a/shared-bindings/audiodelays/Reverb.c b/shared-bindings/audiodelays/Reverb.c index e773fca58dbf1..f104b0e5386f9 100644 --- a/shared-bindings/audiodelays/Reverb.c +++ b/shared-bindings/audiodelays/Reverb.c @@ -79,14 +79,16 @@ //| ... //| static mp_obj_t audiodelays_reverb_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { - enum { ARG_buffer_size, ARG_sample_rate, ARG_bits_per_sample, ARG_samples_signed, ARG_channel_count, ARG_freq_shift, }; + enum { ARG_roomsize, ARG_damp, ARG_mix, ARG_buffer_size, ARG_sample_rate, ARG_bits_per_sample, ARG_samples_signed, ARG_channel_count, }; static const mp_arg_t allowed_args[] = { + { MP_QSTR_roomsize, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_damp, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_mix, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NULL} }, { MP_QSTR_buffer_size, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 512} }, { MP_QSTR_sample_rate, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 8000} }, { MP_QSTR_bits_per_sample, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 16} }, { MP_QSTR_samples_signed, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, { MP_QSTR_channel_count, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 1 } }, - { MP_QSTR_freq_shift, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true } }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; @@ -103,7 +105,7 @@ static mp_obj_t audiodelays_reverb_make_new(const mp_obj_type_t *type, size_t n_ } audiodelays_reverb_obj_t *self = mp_obj_malloc(audiodelays_reverb_obj_t, &audiodelays_reverb_type); - common_hal_audiodelays_reverb_construct(self, args[ARG_buffer_size].u_int, bits_per_sample, args[ARG_samples_signed].u_bool, channel_count, sample_rate, args[ARG_freq_shift].u_bool); + common_hal_audiodelays_reverb_construct(self, args[ARG_roomsize].u_obj, args[ARG_damp].u_obj, args[ARG_mix].u_obj, args[ARG_buffer_size].u_int, bits_per_sample, args[ARG_samples_signed].u_bool, channel_count, sample_rate); return MP_OBJ_FROM_PTR(self); } @@ -136,6 +138,60 @@ static void check_for_deinit(audiodelays_reverb_obj_t *self) { //| // Provided by context manager helper. +//| roomsize: synthio.BlockInput +//| """TODO. Apparent roomsize 0.0-1.0""" +static mp_obj_t audiodelays_reverb_obj_get_roomsize(mp_obj_t self_in) { + return common_hal_audiodelays_reverb_get_roomsize(self_in); +} +MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_reverb_get_roomsize_obj, audiodelays_reverb_obj_get_roomsize); + +static mp_obj_t audiodelays_reverb_obj_set_roomsize(mp_obj_t self_in, mp_obj_t roomsize) { + audiodelays_reverb_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_audiodelays_reverb_set_roomsize(self, roomsize); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(audiodelays_reverb_set_roomsize_obj, audiodelays_reverb_obj_set_roomsize); + +MP_PROPERTY_GETSET(audiodelays_reverb_roomsize_obj, + (mp_obj_t)&audiodelays_reverb_get_roomsize_obj, + (mp_obj_t)&audiodelays_reverb_set_roomsize_obj); + +//| damp: synthio.BlockInput +//| """TODO. How reverbrent the area is. 0.0-1.0""" +static mp_obj_t audiodelays_reverb_obj_get_damp(mp_obj_t self_in) { + return common_hal_audiodelays_reverb_get_damp(self_in); +} +MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_reverb_get_damp_obj, audiodelays_reverb_obj_get_damp); + +static mp_obj_t audiodelays_reverb_obj_set_damp(mp_obj_t self_in, mp_obj_t damp) { + audiodelays_reverb_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_audiodelays_reverb_set_damp(self, damp); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(audiodelays_reverb_set_damp_obj, audiodelays_reverb_obj_set_damp); + +MP_PROPERTY_GETSET(audiodelays_reverb_damp_obj, + (mp_obj_t)&audiodelays_reverb_get_damp_obj, + (mp_obj_t)&audiodelays_reverb_set_damp_obj); + +//| mix: synthio.BlockInput +//| """The rate the reverb mix between 0 and 1 where 0 is only sample and 1 is all effect.""" +static mp_obj_t audiodelays_reverb_obj_get_mix(mp_obj_t self_in) { + return common_hal_audiodelays_reverb_get_mix(self_in); +} +MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_reverb_get_mix_obj, audiodelays_reverb_obj_get_mix); + +static mp_obj_t audiodelays_reverb_obj_set_mix(mp_obj_t self_in, mp_obj_t mix_in) { + audiodelays_reverb_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_audiodelays_reverb_set_mix(self, mix_in); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(audiodelays_reverb_set_mix_obj, audiodelays_reverb_obj_set_mix); + +MP_PROPERTY_GETSET(audiodelays_reverb_mix_obj, + (mp_obj_t)&audiodelays_reverb_get_mix_obj, + (mp_obj_t)&audiodelays_reverb_set_mix_obj); + //| playing: bool //| """True when the effect is playing a sample. (read-only)""" //| @@ -198,6 +254,9 @@ static const mp_rom_map_elem_t audiodelays_reverb_locals_dict_table[] = { // Properties { MP_ROM_QSTR(MP_QSTR_playing), MP_ROM_PTR(&audiodelays_reverb_playing_obj) }, + { MP_ROM_QSTR(MP_QSTR_roomsize), MP_ROM_PTR(&audiodelays_reverb_roomsize_obj) }, + { MP_ROM_QSTR(MP_QSTR_damp), MP_ROM_PTR(&audiodelays_reverb_damp_obj) }, + { MP_ROM_QSTR(MP_QSTR_mix), MP_ROM_PTR(&audiodelays_reverb_mix_obj) }, AUDIOSAMPLE_FIELDS, }; static MP_DEFINE_CONST_DICT(audiodelays_reverb_locals_dict, audiodelays_reverb_locals_dict_table); diff --git a/shared-bindings/audiodelays/Reverb.h b/shared-bindings/audiodelays/Reverb.h index 3b16d34243376..3f859861cb2c3 100644 --- a/shared-bindings/audiodelays/Reverb.h +++ b/shared-bindings/audiodelays/Reverb.h @@ -11,8 +11,9 @@ extern const mp_obj_type_t audiodelays_reverb_type; void common_hal_audiodelays_reverb_construct(audiodelays_reverb_obj_t *self, + mp_obj_t roomsize, mp_obj_t damp, mp_obj_t mix, uint32_t buffer_size, uint8_t bits_per_sample, bool samples_signed, - uint8_t channel_count, uint32_t sample_rate, bool freq_shift); + uint8_t channel_count, uint32_t sample_rate); void common_hal_audiodelays_reverb_deinit(audiodelays_reverb_obj_t *self); bool common_hal_audiodelays_reverb_deinited(audiodelays_reverb_obj_t *self); @@ -21,6 +22,15 @@ uint32_t common_hal_audiodelays_reverb_get_sample_rate(audiodelays_reverb_obj_t uint8_t common_hal_audiodelays_reverb_get_channel_count(audiodelays_reverb_obj_t *self); uint8_t common_hal_audiodelays_reverb_get_bits_per_sample(audiodelays_reverb_obj_t *self); +mp_obj_t common_hal_audiodelays_reverb_get_roomsize(audiodelays_reverb_obj_t *self); +void common_hal_audiodelays_reverb_set_roomsize(audiodelays_reverb_obj_t *self, mp_obj_t feedback); + +mp_obj_t common_hal_audiodelays_reverb_get_damp(audiodelays_reverb_obj_t *self); +void common_hal_audiodelays_reverb_set_damp(audiodelays_reverb_obj_t *self, mp_obj_t damp); + +mp_obj_t common_hal_audiodelays_reverb_get_mix(audiodelays_reverb_obj_t *self); +void common_hal_audiodelays_reverb_set_mix(audiodelays_reverb_obj_t *self, mp_obj_t mix); + bool common_hal_audiodelays_reverb_get_playing(audiodelays_reverb_obj_t *self); void common_hal_audiodelays_reverb_play(audiodelays_reverb_obj_t *self, mp_obj_t sample, bool loop); void common_hal_audiodelays_reverb_stop(audiodelays_reverb_obj_t *self); diff --git a/shared-module/audiodelays/Reverb.c b/shared-module/audiodelays/Reverb.c index 872655a3e0962..108fc95f900b6 100644 --- a/shared-module/audiodelays/Reverb.c +++ b/shared-module/audiodelays/Reverb.c @@ -9,9 +9,9 @@ #include "py/runtime.h" #include -void common_hal_audiodelays_reverb_construct(audiodelays_reverb_obj_t *self, +void common_hal_audiodelays_reverb_construct(audiodelays_reverb_obj_t *self, mp_obj_t roomsize, mp_obj_t damp, mp_obj_t mix, uint32_t buffer_size, uint8_t bits_per_sample, - bool samples_signed, uint8_t channel_count, uint32_t sample_rate, bool freq_shift) { + bool samples_signed, uint8_t channel_count, uint32_t sample_rate) { // Basic settings every effect and audio sample has // These are the effects values, not the source sample(s) @@ -53,6 +53,60 @@ void common_hal_audiodelays_reverb_construct(audiodelays_reverb_obj_t *self, self->more_data = false; // Is there still more data to read from the sample or did we finish // The below section sets up the reverb effect's starting values. For a different effect this section will change + if (roomsize == MP_OBJ_NULL) { + roomsize = mp_obj_new_float(MICROPY_FLOAT_CONST(0.5)); + } + synthio_block_assign_slot(roomsize, &self->roomsize, MP_QSTR_roomsize); + common_hal_audiodelays_reverb_set_roomsize(self, roomsize); + + if (damp == MP_OBJ_NULL) { + damp = mp_obj_new_float(MICROPY_FLOAT_CONST(0.5)); + } + synthio_block_assign_slot(damp, &self->damp, MP_QSTR_damp); + common_hal_audiodelays_reverb_set_damp(self, damp); + + if (mix == MP_OBJ_NULL) { + mix = mp_obj_new_float(MICROPY_FLOAT_CONST(0.5)); + } + synthio_block_assign_slot(mix, &self->mix, MP_QSTR_mix); + common_hal_audiodelays_reverb_set_mix(self, mix); + + // Set up the comb filters + self->combbuffersizes[0] = 1116; + self->combbuffersizes[1] = 1188; + self->combbuffersizes[2] = 1277; + self->combbuffersizes[3] = 1356; + self->combbuffersizes[4] = 1422; + self->combbuffersizes[5] = 1491; + self->combbuffersizes[6] = 1557; + self->combbuffersizes[7] = 1617; + for (uint32_t i = 0; i < 8; i++) { + self->combbuffers[i] = m_malloc(self->combbuffersizes[i] * sizeof(uint16_t)); + if (self->combbuffers[i] == NULL) { + common_hal_audiodelays_reverb_deinit(self); + m_malloc_fail(self->combbuffersizes[i]); + } + memset(self->combbuffers[i], 0, self->combbuffersizes[i]); + + self->combbufferindex[i] = 0; + self->combfitlers[i] = 0; + } + + // Set up the allpass filters + self->allpassbuffersizes[0] = 556; + self->allpassbuffersizes[1] = 441; + self->allpassbuffersizes[2] = 341; + self->allpassbuffersizes[3] = 225; + for (uint32_t i = 0; i < 4; i++) { + self->allpassbuffers[i] = m_malloc(self->allpassbuffersizes[i] * sizeof(uint16_t)); + if (self->allpassbuffers[i] == NULL) { + common_hal_audiodelays_reverb_deinit(self); + m_malloc_fail(self->allpassbuffersizes[i]); + } + memset(self->allpassbuffers[i], 0, self->allpassbuffersizes[i]); + + self->allpassbufferindex[i] = 0; + } } bool common_hal_audiodelays_reverb_deinited(audiodelays_reverb_obj_t *self) { @@ -70,6 +124,51 @@ void common_hal_audiodelays_reverb_deinit(audiodelays_reverb_obj_t *self) { self->buffer[1] = NULL; } +mp_obj_t common_hal_audiodelays_reverb_get_roomsize(audiodelays_reverb_obj_t *self) { + return self->roomsize.obj; +} + +void common_hal_audiodelays_reverb_set_roomsize(audiodelays_reverb_obj_t *self, mp_obj_t roomsize_obj) { + synthio_block_assign_slot(roomsize_obj, &self->roomsize, MP_QSTR_roomsize); +} + +int16_t audiodelays_reverb_get_roomsize_fixedpoint(mp_float_t n) { + if (n > 1.0f) { + n = 1.0f; + } else if (n < 0.0f) { + n = 0.0f; + } + + return (int16_t)(n * 9175.04f) + 22937; // 9175.04 = 0.28f in fixed point 22937 = 0.7f +} + +mp_obj_t common_hal_audiodelays_reverb_get_damp(audiodelays_reverb_obj_t *self) { + return self->damp.obj; +} + +void common_hal_audiodelays_reverb_set_damp(audiodelays_reverb_obj_t *self, mp_obj_t damp) { + synthio_block_assign_slot(damp, &self->damp, MP_QSTR_damp); +} + +void audiodelays_reverb_get_damp_fixedpoint(mp_float_t n, int16_t *damp1, int16_t *damp2) { + if (n > 1.0f) { + n = 1.0f; + } else if (n < 0.0f) { + n = 0.0f; + } + + *damp1 = (int16_t)(n * 13107.2f); // 13107.2 = 0.4f scaling factor + *damp2 = (int16_t)(32768 - *damp1); // inverse of x1 damp2 = 1.0 - damp1 +} + +mp_obj_t common_hal_audiodelays_reverb_get_mix(audiodelays_reverb_obj_t *self) { + return self->mix.obj; +} + +void common_hal_audiodelays_reverb_set_mix(audiodelays_reverb_obj_t *self, mp_obj_t mix) { + synthio_block_assign_slot(mix, &self->mix, MP_QSTR_mix); +} + void audiodelays_reverb_reset_buffer(audiodelays_reverb_obj_t *self, bool single_channel_output, uint8_t channel) { @@ -106,6 +205,27 @@ void common_hal_audiodelays_reverb_stop(audiodelays_reverb_obj_t *self) { return; } +// cleaner sat16 by http://www.moseleyinstruments.com/ +static int16_t sat16(int32_t n, int rshift) { + // we should always round towards 0 + // to avoid recirculating round-off noise + // + // a 2s complement positive number is always + // rounded down, so we only need to take + // care of negative numbers + if (n < 0) { + n = n + (~(0xFFFFFFFFUL << rshift)); + } + n = n >> rshift; + if (n > 32767) { + return 32767; + } + if (n < -32768) { + return -32768; + } + return n; +} + audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj_t *self, bool single_channel_output, uint8_t channel, uint8_t **buffer, uint32_t *buffer_length) { @@ -150,6 +270,12 @@ audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj // get the effect values we need from the BlockInput. These may change at run time so you need to do bounds checking if required shared_bindings_synthio_lfo_tick(self->base.sample_rate, n / self->base.channel_count); + mp_float_t damp = synthio_block_slot_get_limited(&self->damp, MICROPY_FLOAT_CONST(0.0), MICROPY_FLOAT_CONST(1.0)); + int16_t damp1, damp2; + audiodelays_reverb_get_damp_fixedpoint(damp, &damp1, &damp2); + + mp_float_t roomsize = synthio_block_slot_get_limited(&self->roomsize, MICROPY_FLOAT_CONST(0.0), MICROPY_FLOAT_CONST(1.0)); + int16_t feedback = audiodelays_reverb_get_roomsize_fixedpoint(roomsize); // If we have no sample keep the reverb reverbing if (self->sample == NULL) { @@ -164,10 +290,38 @@ audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj for (uint32_t i = 0; i < n; i++) { int32_t sample_word = sample_src[i]; - int32_t word; - word = synthio_mix_down_sample(sample_word, SYNTHIO_MIX_DOWN_SCALE(2)); + int16_t input, bufout, output; + int32_t sum; + + input = sat16(sample_word * 8738, 17); + sum = 0; + + for (uint32_t j = 0; j < 8; j++) { + bufout = self->combbuffers[j][self->combbufferindex[j]]; + sum += bufout; + self->combfitlers[j] = sat16(bufout * damp2 + self->combfitlers[j] * damp1, 15); + self->combbuffers[j][self->combbufferindex[j]] = sat16(input + sat16(self->combfitlers[j] * feedback, 15), 0); + if (++self->combbufferindex[j] >= self->combbuffersizes[j]) { + self->combbufferindex[j] = 0; + } + } + + output = sat16(sum * 31457, 17); // 31457 = 0.96f + for (uint32_t j = 0; j < 4; j++) { + bufout = self->allpassbuffers[j][self->allpassbufferindex[j]]; + self->allpassbuffers[j][self->allpassbufferindex[j]] = output + (bufout >> 1); // bufout >> 1 same as bufout*0.5f + output = sat16(bufout - output, 1); + if (++self->allpassbufferindex[j] >= self->allpassbuffersizes[j]) { + self->allpassbufferindex[j] = 0; + } + } + + word = sat16(output * 30, 0); + + + word = synthio_mix_down_sample(sample_word, SYNTHIO_MIX_DOWN_SCALE(2)); word_buffer[i] = (int16_t)word; } diff --git a/shared-module/audiodelays/Reverb.h b/shared-module/audiodelays/Reverb.h index 300ac0a97904a..6420e7ffd1d16 100644 --- a/shared-module/audiodelays/Reverb.h +++ b/shared-module/audiodelays/Reverb.h @@ -15,6 +15,9 @@ extern const mp_obj_type_t audiodelays_reverb_type; typedef struct { audiosample_base_t base; + synthio_block_slot_t roomsize; + synthio_block_slot_t damp; + synthio_block_slot_t mix; int8_t *buffer[2]; uint8_t last_buf_idx; @@ -26,6 +29,15 @@ typedef struct { bool loop; bool more_data; + int16_t combbuffersizes[8]; + int16_t *combbuffers[8]; + int16_t combbufferindex[8]; + int16_t combfitlers[8]; + + int16_t allpassbuffersizes[4]; + int16_t *allpassbuffers[4]; + int16_t allpassbufferindex[4]; + mp_obj_t sample; } audiodelays_reverb_obj_t; @@ -38,3 +50,6 @@ audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj uint8_t channel, uint8_t **buffer, uint32_t *buffer_length); // length in bytes + +int16_t audiodelays_reverb_get_roomsize_fixedpoint(mp_float_t n); +void audiodelays_reverb_get_damp_fixedpoint(mp_float_t n, int16_t *damp1, int16_t *damp2); From c7991ada78eb7d25ca5eb2e3c8e0c0b22b30b57e Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 22 Mar 2025 15:00:26 -0500 Subject: [PATCH 03/24] Temp stereo fix and send the right sample --- shared-module/audiodelays/Reverb.c | 31 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/shared-module/audiodelays/Reverb.c b/shared-module/audiodelays/Reverb.c index 108fc95f900b6..682ec85c5f1a8 100644 --- a/shared-module/audiodelays/Reverb.c +++ b/shared-module/audiodelays/Reverb.c @@ -71,15 +71,15 @@ void common_hal_audiodelays_reverb_construct(audiodelays_reverb_obj_t *self, mp_ synthio_block_assign_slot(mix, &self->mix, MP_QSTR_mix); common_hal_audiodelays_reverb_set_mix(self, mix); - // Set up the comb filters - self->combbuffersizes[0] = 1116; - self->combbuffersizes[1] = 1188; - self->combbuffersizes[2] = 1277; - self->combbuffersizes[3] = 1356; - self->combbuffersizes[4] = 1422; - self->combbuffersizes[5] = 1491; - self->combbuffersizes[6] = 1557; - self->combbuffersizes[7] = 1617; + // Set up the comb filters * 2 for L/R (for now) + self->combbuffersizes[0] = 1116 * 2; + self->combbuffersizes[1] = 1188 * 2; + self->combbuffersizes[2] = 1277 * 2; + self->combbuffersizes[3] = 1356 * 2; + self->combbuffersizes[4] = 1422 * 2; + self->combbuffersizes[5] = 1491 * 2; + self->combbuffersizes[6] = 1557 * 2; + self->combbuffersizes[7] = 1617 * 2; for (uint32_t i = 0; i < 8; i++) { self->combbuffers[i] = m_malloc(self->combbuffersizes[i] * sizeof(uint16_t)); if (self->combbuffers[i] == NULL) { @@ -93,10 +93,10 @@ void common_hal_audiodelays_reverb_construct(audiodelays_reverb_obj_t *self, mp_ } // Set up the allpass filters - self->allpassbuffersizes[0] = 556; - self->allpassbuffersizes[1] = 441; - self->allpassbuffersizes[2] = 341; - self->allpassbuffersizes[3] = 225; + self->allpassbuffersizes[0] = 556 * 2; + self->allpassbuffersizes[1] = 441 * 2; + self->allpassbuffersizes[2] = 341 * 2; + self->allpassbuffersizes[3] = 225 * 2; for (uint32_t i = 0; i < 4; i++) { self->allpassbuffers[i] = m_malloc(self->allpassbuffersizes[i] * sizeof(uint16_t)); if (self->allpassbuffers[i] == NULL) { @@ -318,10 +318,9 @@ audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj } } - word = sat16(output * 30, 0); + word = output * 30; - - word = synthio_mix_down_sample(sample_word, SYNTHIO_MIX_DOWN_SCALE(2)); + word = synthio_mix_down_sample(word, SYNTHIO_MIX_DOWN_SCALE(2)); word_buffer[i] = (int16_t)word; } From d2173ae3879bd5400dfb1106b0fdb1f106ef9f72 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 22 Mar 2025 15:59:58 -0500 Subject: [PATCH 04/24] Changes to stereo handling --- shared-module/audiodelays/Reverb.c | 47 ++++++++++++++++++------------ shared-module/audiodelays/Reverb.h | 16 +++++----- 2 files changed, 36 insertions(+), 27 deletions(-) diff --git a/shared-module/audiodelays/Reverb.c b/shared-module/audiodelays/Reverb.c index 682ec85c5f1a8..6044220baf72e 100644 --- a/shared-module/audiodelays/Reverb.c +++ b/shared-module/audiodelays/Reverb.c @@ -71,16 +71,16 @@ void common_hal_audiodelays_reverb_construct(audiodelays_reverb_obj_t *self, mp_ synthio_block_assign_slot(mix, &self->mix, MP_QSTR_mix); common_hal_audiodelays_reverb_set_mix(self, mix); - // Set up the comb filters * 2 for L/R (for now) - self->combbuffersizes[0] = 1116 * 2; - self->combbuffersizes[1] = 1188 * 2; - self->combbuffersizes[2] = 1277 * 2; - self->combbuffersizes[3] = 1356 * 2; - self->combbuffersizes[4] = 1422 * 2; - self->combbuffersizes[5] = 1491 * 2; - self->combbuffersizes[6] = 1557 * 2; - self->combbuffersizes[7] = 1617 * 2; - for (uint32_t i = 0; i < 8; i++) { + // Set up the comb filters + self->combbuffersizes[0] = self->combbuffersizes[8] = 1116; + self->combbuffersizes[1] = self->combbuffersizes[9] = 1188; + self->combbuffersizes[2] = self->combbuffersizes[10] = 1277; + self->combbuffersizes[3] = self->combbuffersizes[11] = 1356; + self->combbuffersizes[4] = self->combbuffersizes[12] = 1422; + self->combbuffersizes[5] = self->combbuffersizes[13] = 1491; + self->combbuffersizes[6] = self->combbuffersizes[14] = 1557; + self->combbuffersizes[7] = self->combbuffersizes[15] = 1617; + for (uint32_t i = 0; i < 8 * channel_count; i++) { self->combbuffers[i] = m_malloc(self->combbuffersizes[i] * sizeof(uint16_t)); if (self->combbuffers[i] == NULL) { common_hal_audiodelays_reverb_deinit(self); @@ -93,11 +93,11 @@ void common_hal_audiodelays_reverb_construct(audiodelays_reverb_obj_t *self, mp_ } // Set up the allpass filters - self->allpassbuffersizes[0] = 556 * 2; - self->allpassbuffersizes[1] = 441 * 2; - self->allpassbuffersizes[2] = 341 * 2; - self->allpassbuffersizes[3] = 225 * 2; - for (uint32_t i = 0; i < 4; i++) { + self->allpassbuffersizes[0] = self->allpassbuffersizes[4] = 556; + self->allpassbuffersizes[1] = self->allpassbuffersizes[5] = 441; + self->allpassbuffersizes[2] = self->allpassbuffersizes[6] = 341; + self->allpassbuffersizes[3] = self->allpassbuffersizes[7] = 225; + for (uint32_t i = 0; i < 4 * channel_count; i++) { self->allpassbuffers[i] = m_malloc(self->allpassbuffersizes[i] * sizeof(uint16_t)); if (self->allpassbuffers[i] == NULL) { common_hal_audiodelays_reverb_deinit(self); @@ -290,14 +290,15 @@ audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj for (uint32_t i = 0; i < n; i++) { int32_t sample_word = sample_src[i]; - int32_t word; + + int32_t word, sum; int16_t input, bufout, output; - int32_t sum; + uint32_t channel_comb_offset = 0, channel_allpass_offset = 0; input = sat16(sample_word * 8738, 17); sum = 0; - for (uint32_t j = 0; j < 8; j++) { + for (uint32_t j = 0 + channel_comb_offset; j < 8 + channel_comb_offset; j++) { bufout = self->combbuffers[j][self->combbufferindex[j]]; sum += bufout; self->combfitlers[j] = sat16(bufout * damp2 + self->combfitlers[j] * damp1, 15); @@ -309,7 +310,7 @@ audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj output = sat16(sum * 31457, 17); // 31457 = 0.96f - for (uint32_t j = 0; j < 4; j++) { + for (uint32_t j = 0 + channel_allpass_offset; j < 4 + channel_allpass_offset; j++) { bufout = self->allpassbuffers[j][self->allpassbufferindex[j]]; self->allpassbuffers[j][self->allpassbufferindex[j]] = output + (bufout >> 1); // bufout >> 1 same as bufout*0.5f output = sat16(bufout - output, 1); @@ -322,6 +323,14 @@ audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj word = synthio_mix_down_sample(word, SYNTHIO_MIX_DOWN_SCALE(2)); word_buffer[i] = (int16_t)word; + + if ((self->base.channel_count == 2) && (channel_comb_offset == 0)) { + channel_comb_offset = 8; + channel_allpass_offset = 4; + } else { + channel_comb_offset = 0; + channel_allpass_offset = 0; + } } // Update the remaining length and the buffer positions based on how much we wrote into our buffer diff --git a/shared-module/audiodelays/Reverb.h b/shared-module/audiodelays/Reverb.h index 6420e7ffd1d16..82d945353c456 100644 --- a/shared-module/audiodelays/Reverb.h +++ b/shared-module/audiodelays/Reverb.h @@ -29,14 +29,14 @@ typedef struct { bool loop; bool more_data; - int16_t combbuffersizes[8]; - int16_t *combbuffers[8]; - int16_t combbufferindex[8]; - int16_t combfitlers[8]; - - int16_t allpassbuffersizes[4]; - int16_t *allpassbuffers[4]; - int16_t allpassbufferindex[4]; + int16_t combbuffersizes[16]; + int16_t *combbuffers[16]; + int16_t combbufferindex[16]; + int16_t combfitlers[16]; + + int16_t allpassbuffersizes[8]; + int16_t *allpassbuffers[8]; + int16_t allpassbufferindex[8]; mp_obj_t sample; } audiodelays_reverb_obj_t; From 9a148f7f2f86f4b3ff1a31a49fef8f7b1f0b00b6 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sun, 23 Mar 2025 11:27:54 -0500 Subject: [PATCH 05/24] Temp mix test --- shared-module/audiodelays/Reverb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared-module/audiodelays/Reverb.c b/shared-module/audiodelays/Reverb.c index 6044220baf72e..235fda59ec76a 100644 --- a/shared-module/audiodelays/Reverb.c +++ b/shared-module/audiodelays/Reverb.c @@ -273,6 +273,7 @@ audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj mp_float_t damp = synthio_block_slot_get_limited(&self->damp, MICROPY_FLOAT_CONST(0.0), MICROPY_FLOAT_CONST(1.0)); int16_t damp1, damp2; audiodelays_reverb_get_damp_fixedpoint(damp, &damp1, &damp2); + mp_float_t mix = synthio_block_slot_get_limited(&self->mix, MICROPY_FLOAT_CONST(0.0), MICROPY_FLOAT_CONST(1.0)); mp_float_t roomsize = synthio_block_slot_get_limited(&self->roomsize, MICROPY_FLOAT_CONST(0.0), MICROPY_FLOAT_CONST(1.0)); int16_t feedback = audiodelays_reverb_get_roomsize_fixedpoint(roomsize); @@ -321,6 +322,7 @@ audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj word = output * 30; + word = (sample_word * (MICROPY_FLOAT_CONST(1.0) - mix)) + (word * mix); word = synthio_mix_down_sample(word, SYNTHIO_MIX_DOWN_SCALE(2)); word_buffer[i] = (int16_t)word; From 4359a21c244c5d5d8e4ea22b982e1d76a10e0b09 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Tue, 1 Apr 2025 19:29:21 -0500 Subject: [PATCH 06/24] Fix error if no sample add in comments --- shared-module/audiodelays/Reverb.c | 103 ++++++++++++++--------------- 1 file changed, 50 insertions(+), 53 deletions(-) diff --git a/shared-module/audiodelays/Reverb.c b/shared-module/audiodelays/Reverb.c index 235fda59ec76a..36560722a4f40 100644 --- a/shared-module/audiodelays/Reverb.c +++ b/shared-module/audiodelays/Reverb.c @@ -3,6 +3,10 @@ // SPDX-FileCopyrightText: Copyright (c) 2025 Mark Komus // // SPDX-License-Identifier: MIT +// +// Based on FreeVerb - https://github.com/sinshu/freeverb/tree/main +// Fixed point ideas from - Paul Stoffregen in the Teensy audio library https://github.com/PaulStoffregen/Audio/blob/master/effect_freeverb.cpp +// #include "shared-bindings/audiodelays/Reverb.h" #include @@ -278,69 +282,62 @@ audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj mp_float_t roomsize = synthio_block_slot_get_limited(&self->roomsize, MICROPY_FLOAT_CONST(0.0), MICROPY_FLOAT_CONST(1.0)); int16_t feedback = audiodelays_reverb_get_roomsize_fixedpoint(roomsize); - // If we have no sample keep the reverb reverbing - if (self->sample == NULL) { - // Since we have no sample we can just iterate over the our entire remaining buffer and finish - for (uint32_t i = 0; i < n; i++) { - int16_t word = 0; - word_buffer[i] = word; + int16_t *sample_src = (int16_t *)self->sample_remaining_buffer; + + for (uint32_t i = 0; i < n; i++) { + int32_t sample_word = 0; + if (self->sample != NULL) { + sample_word = sample_src[i]; } - } else { - // we have a sample to play - int16_t *sample_src = (int16_t *)self->sample_remaining_buffer; - - for (uint32_t i = 0; i < n; i++) { - int32_t sample_word = sample_src[i]; - - int32_t word, sum; - int16_t input, bufout, output; - uint32_t channel_comb_offset = 0, channel_allpass_offset = 0; - - input = sat16(sample_word * 8738, 17); - sum = 0; - - for (uint32_t j = 0 + channel_comb_offset; j < 8 + channel_comb_offset; j++) { - bufout = self->combbuffers[j][self->combbufferindex[j]]; - sum += bufout; - self->combfitlers[j] = sat16(bufout * damp2 + self->combfitlers[j] * damp1, 15); - self->combbuffers[j][self->combbufferindex[j]] = sat16(input + sat16(self->combfitlers[j] * feedback, 15), 0); - if (++self->combbufferindex[j] >= self->combbuffersizes[j]) { - self->combbufferindex[j] = 0; - } - } - output = sat16(sum * 31457, 17); // 31457 = 0.96f + int32_t word, sum; + int16_t input, bufout, output; + uint32_t channel_comb_offset = 0, channel_allpass_offset = 0; - for (uint32_t j = 0 + channel_allpass_offset; j < 4 + channel_allpass_offset; j++) { - bufout = self->allpassbuffers[j][self->allpassbufferindex[j]]; - self->allpassbuffers[j][self->allpassbufferindex[j]] = output + (bufout >> 1); // bufout >> 1 same as bufout*0.5f - output = sat16(bufout - output, 1); - if (++self->allpassbufferindex[j] >= self->allpassbuffersizes[j]) { - self->allpassbufferindex[j] = 0; - } - } + input = sat16(sample_word * 8738, 17); + sum = 0; - word = output * 30; + for (uint32_t j = 0 + channel_comb_offset; j < 8 + channel_comb_offset; j++) { + bufout = self->combbuffers[j][self->combbufferindex[j]]; + sum += bufout; + self->combfitlers[j] = sat16(bufout * damp2 + self->combfitlers[j] * damp1, 15); + self->combbuffers[j][self->combbufferindex[j]] = sat16(input + sat16(self->combfitlers[j] * feedback, 15), 0); + if (++self->combbufferindex[j] >= self->combbuffersizes[j]) { + self->combbufferindex[j] = 0; + } + } - word = (sample_word * (MICROPY_FLOAT_CONST(1.0) - mix)) + (word * mix); - word = synthio_mix_down_sample(word, SYNTHIO_MIX_DOWN_SCALE(2)); - word_buffer[i] = (int16_t)word; + output = sat16(sum * 31457, 17); // 31457 = 0.96f - if ((self->base.channel_count == 2) && (channel_comb_offset == 0)) { - channel_comb_offset = 8; - channel_allpass_offset = 4; - } else { - channel_comb_offset = 0; - channel_allpass_offset = 0; + for (uint32_t j = 0 + channel_allpass_offset; j < 4 + channel_allpass_offset; j++) { + bufout = self->allpassbuffers[j][self->allpassbufferindex[j]]; + self->allpassbuffers[j][self->allpassbufferindex[j]] = output + (bufout >> 1); // bufout >> 1 same as bufout*0.5f + output = sat16(bufout - output, 1); + if (++self->allpassbufferindex[j] >= self->allpassbuffersizes[j]) { + self->allpassbufferindex[j] = 0; } } - // Update the remaining length and the buffer positions based on how much we wrote into our buffer - length -= n; - word_buffer += n; - self->sample_remaining_buffer += (n * (self->base.bits_per_sample / 8)); - self->sample_buffer_length -= n; + word = output * 30; + + word = (sample_word * (MICROPY_FLOAT_CONST(1.0) - mix)) + (word * mix); + word = synthio_mix_down_sample(word, SYNTHIO_MIX_DOWN_SCALE(2)); + word_buffer[i] = (int16_t)word; + + if ((self->base.channel_count == 2) && (channel_comb_offset == 0)) { + channel_comb_offset = 8; + channel_allpass_offset = 4; + } else { + channel_comb_offset = 0; + channel_allpass_offset = 0; + } } + + // Update the remaining length and the buffer positions based on how much we wrote into our buffer + length -= n; + word_buffer += n; + self->sample_remaining_buffer += (n * (self->base.bits_per_sample / 8)); + self->sample_buffer_length -= n; } // Finally pass our buffer and length to the calling audio function From 89c4110b3efb1884bde4cdb4972e98adaef78ee6 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Wed, 2 Apr 2025 19:48:59 -0500 Subject: [PATCH 07/24] Fixed copyright year oops --- shared-bindings/audiodelays/Reverb.c | 2 +- shared-bindings/audiodelays/Reverb.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/audiodelays/Reverb.c b/shared-bindings/audiodelays/Reverb.c index f104b0e5386f9..37bb5dcd2dfeb 100644 --- a/shared-bindings/audiodelays/Reverb.c +++ b/shared-bindings/audiodelays/Reverb.c @@ -1,6 +1,6 @@ // This file is part of the CircuitPython project: https://circuitpython.org // -// SPDX-FileCopyrightText: Copyright (c) 2024 Mark Komus +// SPDX-FileCopyrightText: Copyright (c) 2025 Mark Komus // // SPDX-License-Identifier: MIT diff --git a/shared-bindings/audiodelays/Reverb.h b/shared-bindings/audiodelays/Reverb.h index 3f859861cb2c3..9c2ae570a3d35 100644 --- a/shared-bindings/audiodelays/Reverb.h +++ b/shared-bindings/audiodelays/Reverb.h @@ -1,6 +1,6 @@ // This file is part of the CircuitPython project: https://circuitpython.org // -// SPDX-FileCopyrightText: Copyright (c) 2024 Mark Komus +// SPDX-FileCopyrightText: Copyright (c) 2025 Mark Komus // // SPDX-License-Identifier: MIT From 9cdc3d7097367270cf79c86b071a0692703c4b46 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 5 Apr 2025 11:53:32 -0500 Subject: [PATCH 08/24] Doc addition and better mix --- shared-bindings/audiodelays/Reverb.c | 35 +++++++++++----------------- shared-module/audiodelays/Reverb.c | 11 ++++++++- shared-module/audiodelays/Reverb.h | 1 + 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/shared-bindings/audiodelays/Reverb.c b/shared-bindings/audiodelays/Reverb.c index 37bb5dcd2dfeb..bcd5c96382b57 100644 --- a/shared-bindings/audiodelays/Reverb.c +++ b/shared-bindings/audiodelays/Reverb.c @@ -17,17 +17,13 @@ #include "shared-bindings/util.h" #include "shared-module/synthio/block.h" -#define DECAY_DEFAULT 0.7f -#define MIX_DEFAULT 0.5f - //| class Reverb: //| """An Reverb effect""" //| //| def __init__( //| self, -//| max_delay_ms: int = 500, -//| delay_ms: synthio.BlockInput = 250.0, -//| decay: synthio.BlockInput = 0.7, +//| roomsize: synthio.BlockInput = 0.5, +//| damp: synthio.BlockInput = 0.5, //| mix: synthio.BlockInput = 0.5, //| buffer_size: int = 512, //| sample_rate: int = 8000, @@ -35,26 +31,21 @@ //| samples_signed: bool = True, //| channel_count: int = 1, //| ) -> None: -//| """Create a Reverb effect where you hear the original sample play back, at a lesser volume after -//| a set number of millisecond delay. The delay timing of the reverb can be changed at runtime -//| with the delay_ms parameter but the delay can never exceed the max_delay_ms parameter. The -//| maximum delay you can set is limited by available memory. -//| -//| Each time the reverb plays back the volume is reduced by the decay setting (reverb * decay). +//| """Create a Reverb effect simulating the audio taking place in a large room where you get echos +//| off of various surfaces at various times. The size of the room can be adjusted as well as how +//| much the higher frequencies get absorbed by the walls. //| //| The mix parameter allows you to change how much of the unchanged sample passes through to //| the output to how much of the effect audio you hear as the output. //| -//| :param int max_delay_ms: The maximum time the reverb can be in milliseconds -//| :param synthio.BlockInput delay_ms: The current time of the reverb delay in milliseconds. Must be less the max_delay_ms -//| :param synthio.BlockInput decay: The rate the reverb fades. 0.0 = instant; 1.0 = never. +//| :param synthio.BlockInput roomsize: The size of the room. 0.0 = smallest; 1.0 = largest. +//| :param synthio.BlockInput damp: How much the walls absorb. 0.0 = least; 1.0 = most. //| :param synthio.BlockInput mix: The mix as a ratio of the sample (0.0) to the effect (1.0). //| :param int buffer_size: The total size in bytes of each of the two playback buffers to use //| :param int sample_rate: The sample rate to be used //| :param int channel_count: The number of channels the source samples contain. 1 = mono; 2 = stereo. -//| :param int bits_per_sample: The bits per sample of the effect -//| :param bool samples_signed: Effect is signed (True) or unsigned (False) -//| :param bool freq_shift: Do reverbs change frequency as the reverb delay changes +//| :param int bits_per_sample: The bits per sample of the effect. Reverb requires 16 bits. +//| :param bool samples_signed: Effect is signed (True) or unsigned (False). Reverb requires signed (True). //| //| Playing adding an reverb to a synth:: //| @@ -66,14 +57,14 @@ //| //| audio = audiobusio.I2SOut(bit_clock=board.GP20, word_select=board.GP21, data=board.GP22) //| synth = synthio.Synthesizer(channel_count=1, sample_rate=44100) -//| reverb = audiodelays.Reverb(max_delay_ms=1000, delay_ms=850, decay=0.65, buffer_size=1024, channel_count=1, sample_rate=44100, mix=0.7, freq_shift=False) +//| reverb = audiodelays.Reverb(roomsize=0.7, damp=0.3, buffer_size=1024, channel_count=1, sample_rate=44100, mix=0.7) //| reverb.play(synth) //| audio.play(reverb) //| //| note = synthio.Note(261) //| while True: //| synth.press(note) -//| time.sleep(0.25) +//| time.sleep(0.55) //| synth.release(note) //| time.sleep(5)""" //| ... @@ -139,7 +130,7 @@ static void check_for_deinit(audiodelays_reverb_obj_t *self) { // Provided by context manager helper. //| roomsize: synthio.BlockInput -//| """TODO. Apparent roomsize 0.0-1.0""" +//| """Apparent size of the room 0.0-1.0""" static mp_obj_t audiodelays_reverb_obj_get_roomsize(mp_obj_t self_in) { return common_hal_audiodelays_reverb_get_roomsize(self_in); } @@ -157,7 +148,7 @@ MP_PROPERTY_GETSET(audiodelays_reverb_roomsize_obj, (mp_obj_t)&audiodelays_reverb_set_roomsize_obj); //| damp: synthio.BlockInput -//| """TODO. How reverbrent the area is. 0.0-1.0""" +//| """How reverbrent the area is. 0.0-1.0""" static mp_obj_t audiodelays_reverb_obj_get_damp(mp_obj_t self_in) { return common_hal_audiodelays_reverb_get_damp(self_in); } diff --git a/shared-module/audiodelays/Reverb.c b/shared-module/audiodelays/Reverb.c index 36560722a4f40..fe3144cc5745b 100644 --- a/shared-module/audiodelays/Reverb.c +++ b/shared-module/audiodelays/Reverb.c @@ -173,6 +173,12 @@ void common_hal_audiodelays_reverb_set_mix(audiodelays_reverb_obj_t *self, mp_ob synthio_block_assign_slot(mix, &self->mix, MP_QSTR_mix); } +void audiodelays_reverb_get_mix_fixedpoint(mp_float_t mix, int16_t *mix_sample, int16_t *mix_effect) { + mix = mix * MICROPY_FLOAT_CONST(2.0); + *mix_sample = MIN(MICROPY_FLOAT_CONST(2.0) - mix, MICROPY_FLOAT_CONST(1.0)) * 32767; + *mix_effect = MIN(mix, MICROPY_FLOAT_CONST(1.0)) * 32767; +} + void audiodelays_reverb_reset_buffer(audiodelays_reverb_obj_t *self, bool single_channel_output, uint8_t channel) { @@ -277,7 +283,10 @@ audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj mp_float_t damp = synthio_block_slot_get_limited(&self->damp, MICROPY_FLOAT_CONST(0.0), MICROPY_FLOAT_CONST(1.0)); int16_t damp1, damp2; audiodelays_reverb_get_damp_fixedpoint(damp, &damp1, &damp2); + mp_float_t mix = synthio_block_slot_get_limited(&self->mix, MICROPY_FLOAT_CONST(0.0), MICROPY_FLOAT_CONST(1.0)); + int16_t mix_sample, mix_effect; + audiodelays_reverb_get_mix_fixedpoint(mix, &mix_sample, &mix_effect); mp_float_t roomsize = synthio_block_slot_get_limited(&self->roomsize, MICROPY_FLOAT_CONST(0.0), MICROPY_FLOAT_CONST(1.0)); int16_t feedback = audiodelays_reverb_get_roomsize_fixedpoint(roomsize); @@ -320,7 +329,7 @@ audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj word = output * 30; - word = (sample_word * (MICROPY_FLOAT_CONST(1.0) - mix)) + (word * mix); + word = sat16(sample_word * mix_sample, 15) + sat16(word * mix_effect, 15); word = synthio_mix_down_sample(word, SYNTHIO_MIX_DOWN_SCALE(2)); word_buffer[i] = (int16_t)word; diff --git a/shared-module/audiodelays/Reverb.h b/shared-module/audiodelays/Reverb.h index 82d945353c456..0ce2d5bad2099 100644 --- a/shared-module/audiodelays/Reverb.h +++ b/shared-module/audiodelays/Reverb.h @@ -53,3 +53,4 @@ audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj int16_t audiodelays_reverb_get_roomsize_fixedpoint(mp_float_t n); void audiodelays_reverb_get_damp_fixedpoint(mp_float_t n, int16_t *damp1, int16_t *damp2); +void audiodelays_reverb_get_mix_fixedpoint(mp_float_t mix, int16_t *mix_sample, int16_t *mix_effect); From 0e79f5b7950c2f07d19f62033985cf0467bce8a0 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 5 Apr 2025 13:01:01 -0500 Subject: [PATCH 09/24] Comments and unix build --- shared-module/audiodelays/Reverb.c | 40 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/shared-module/audiodelays/Reverb.c b/shared-module/audiodelays/Reverb.c index fe3144cc5745b..8e069e05b9340 100644 --- a/shared-module/audiodelays/Reverb.c +++ b/shared-module/audiodelays/Reverb.c @@ -76,6 +76,7 @@ void common_hal_audiodelays_reverb_construct(audiodelays_reverb_obj_t *self, mp_ common_hal_audiodelays_reverb_set_mix(self, mix); // Set up the comb filters + // These values come from FreeVerb and are selected for the best reverb sound self->combbuffersizes[0] = self->combbuffersizes[8] = 1116; self->combbuffersizes[1] = self->combbuffersizes[9] = 1188; self->combbuffersizes[2] = self->combbuffersizes[10] = 1277; @@ -97,6 +98,7 @@ void common_hal_audiodelays_reverb_construct(audiodelays_reverb_obj_t *self, mp_ } // Set up the allpass filters + // These values come from FreeVerb and are selected for the best reverb sound self->allpassbuffersizes[0] = self->allpassbuffersizes[4] = 556; self->allpassbuffersizes[1] = self->allpassbuffersizes[5] = 441; self->allpassbuffersizes[2] = self->allpassbuffersizes[6] = 341; @@ -137,13 +139,13 @@ void common_hal_audiodelays_reverb_set_roomsize(audiodelays_reverb_obj_t *self, } int16_t audiodelays_reverb_get_roomsize_fixedpoint(mp_float_t n) { - if (n > 1.0f) { - n = 1.0f; - } else if (n < 0.0f) { - n = 0.0f; + if (n > (mp_float_t)MICROPY_FLOAT_CONST(1.0f)) { + n = MICROPY_FLOAT_CONST(1.0f); + } else if (n < (mp_float_t)MICROPY_FLOAT_CONST(0.0f)) { + n = MICROPY_FLOAT_CONST(0.0f); } - return (int16_t)(n * 9175.04f) + 22937; // 9175.04 = 0.28f in fixed point 22937 = 0.7f + return (int16_t)(n * (mp_float_t)MICROPY_FLOAT_CONST(9175.04f)) + 22937; // 9175.04 = 0.28f in fixed point 22937 = 0.7f } mp_obj_t common_hal_audiodelays_reverb_get_damp(audiodelays_reverb_obj_t *self) { @@ -155,13 +157,13 @@ void common_hal_audiodelays_reverb_set_damp(audiodelays_reverb_obj_t *self, mp_o } void audiodelays_reverb_get_damp_fixedpoint(mp_float_t n, int16_t *damp1, int16_t *damp2) { - if (n > 1.0f) { - n = 1.0f; - } else if (n < 0.0f) { - n = 0.0f; + if (n > (mp_float_t)MICROPY_FLOAT_CONST(1.0f)) { + n = MICROPY_FLOAT_CONST(1.0f); + } else if (n < (mp_float_t)MICROPY_FLOAT_CONST(0.0f)) { + n = MICROPY_FLOAT_CONST(0.0f); } - *damp1 = (int16_t)(n * 13107.2f); // 13107.2 = 0.4f scaling factor + *damp1 = (int16_t)(n * (mp_float_t)MICROPY_FLOAT_CONST(13107.2f)); // 13107.2 = 0.4f scaling factor *damp2 = (int16_t)(32768 - *damp1); // inverse of x1 damp2 = 1.0 - damp1 } @@ -174,9 +176,9 @@ void common_hal_audiodelays_reverb_set_mix(audiodelays_reverb_obj_t *self, mp_ob } void audiodelays_reverb_get_mix_fixedpoint(mp_float_t mix, int16_t *mix_sample, int16_t *mix_effect) { - mix = mix * MICROPY_FLOAT_CONST(2.0); - *mix_sample = MIN(MICROPY_FLOAT_CONST(2.0) - mix, MICROPY_FLOAT_CONST(1.0)) * 32767; - *mix_effect = MIN(mix, MICROPY_FLOAT_CONST(1.0)) * 32767; + mix = mix * (mp_float_t)MICROPY_FLOAT_CONST(2.0f); + *mix_sample = (int16_t)MIN((mp_float_t)MICROPY_FLOAT_CONST(2.0f) - mix, (mp_float_t)MICROPY_FLOAT_CONST(1.0f)) * 32767; + *mix_effect = (int16_t)MIN(mix, (mp_float_t)MICROPY_FLOAT_CONST(1.0f)) * 32767; } void audiodelays_reverb_reset_buffer(audiodelays_reverb_obj_t *self, @@ -239,10 +241,6 @@ static int16_t sat16(int32_t n, int rshift) { audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj_t *self, bool single_channel_output, uint8_t channel, uint8_t **buffer, uint32_t *buffer_length) { - if (!single_channel_output) { - channel = 0; - } - // Switch our buffers to the other buffer self->last_buf_idx = !self->last_buf_idx; @@ -303,9 +301,10 @@ audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj int16_t input, bufout, output; uint32_t channel_comb_offset = 0, channel_allpass_offset = 0; - input = sat16(sample_word * 8738, 17); + input = sat16(sample_word * 8738, 17); // Initial input scaled down so we can add reverb sum = 0; + // Calculate each of the 8 comb buffers for (uint32_t j = 0 + channel_comb_offset; j < 8 + channel_comb_offset; j++) { bufout = self->combbuffers[j][self->combbufferindex[j]]; sum += bufout; @@ -316,8 +315,9 @@ audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj } } - output = sat16(sum * 31457, 17); // 31457 = 0.96f + output = sat16(sum * 31457, 17); // 31457 = 0.24f with shift of 17 + // Calculate each of the 4 all pass buffers for (uint32_t j = 0 + channel_allpass_offset; j < 4 + channel_allpass_offset; j++) { bufout = self->allpassbuffers[j][self->allpassbufferindex[j]]; self->allpassbuffers[j][self->allpassbufferindex[j]] = output + (bufout >> 1); // bufout >> 1 same as bufout*0.5f @@ -327,7 +327,7 @@ audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj } } - word = output * 30; + word = output * 30; // Add some volume back don't have to saturate as next step will word = sat16(sample_word * mix_sample, 15) + sat16(word * mix_effect, 15); word = synthio_mix_down_sample(word, SYNTHIO_MIX_DOWN_SCALE(2)); From edb6810d5538518c217e95105f93611f48f5fa41 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 5 Apr 2025 13:05:10 -0500 Subject: [PATCH 10/24] Unix build file update --- ports/unix/variants/coverage/mpconfigvariant.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/unix/variants/coverage/mpconfigvariant.mk b/ports/unix/variants/coverage/mpconfigvariant.mk index 94a246e0199b0..b288c15fdc140 100644 --- a/ports/unix/variants/coverage/mpconfigvariant.mk +++ b/ports/unix/variants/coverage/mpconfigvariant.mk @@ -35,6 +35,7 @@ SRC_BITMAP := \ shared-bindings/audiocore/WaveFile.c \ shared-bindings/audiodelays/Echo.c \ shared-bindings/audiodelays/PitchShift.c \ + shared-bindings/audiodelays/Reverb.c \ shared-bindings/audiodelays/__init__.c \ shared-bindings/audiofilters/Distortion.c \ shared-bindings/audiofilters/Filter.c \ @@ -79,6 +80,7 @@ SRC_BITMAP := \ shared-module/audiocore/WaveFile.c \ shared-module/audiodelays/Echo.c \ shared-module/audiodelays/PitchShift.c \ + shared-module/audiodelays/Reverb.c \ shared-module/audiodelays/__init__.c \ shared-module/audiofilters/Distortion.c \ shared-module/audiofilters/Filter.c \ From f8647a36fa9c88ff0e6ac1661bdaae80aa8bbb89 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 5 Apr 2025 13:35:35 -0500 Subject: [PATCH 11/24] Removing extra f float markers --- shared-module/audiodelays/Reverb.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/shared-module/audiodelays/Reverb.c b/shared-module/audiodelays/Reverb.c index 8e069e05b9340..81270a47a942f 100644 --- a/shared-module/audiodelays/Reverb.c +++ b/shared-module/audiodelays/Reverb.c @@ -139,13 +139,13 @@ void common_hal_audiodelays_reverb_set_roomsize(audiodelays_reverb_obj_t *self, } int16_t audiodelays_reverb_get_roomsize_fixedpoint(mp_float_t n) { - if (n > (mp_float_t)MICROPY_FLOAT_CONST(1.0f)) { - n = MICROPY_FLOAT_CONST(1.0f); - } else if (n < (mp_float_t)MICROPY_FLOAT_CONST(0.0f)) { - n = MICROPY_FLOAT_CONST(0.0f); + if (n > (mp_float_t)MICROPY_FLOAT_CONST(1.0)) { + n = MICROPY_FLOAT_CONST(1.0); + } else if (n < (mp_float_t)MICROPY_FLOAT_CONST(0.0)) { + n = MICROPY_FLOAT_CONST(0.0); } - return (int16_t)(n * (mp_float_t)MICROPY_FLOAT_CONST(9175.04f)) + 22937; // 9175.04 = 0.28f in fixed point 22937 = 0.7f + return (int16_t)(n * (mp_float_t)MICROPY_FLOAT_CONST(9175.04)) + 22937; // 9175.04 = 0.28f in fixed point 22937 = 0.7f } mp_obj_t common_hal_audiodelays_reverb_get_damp(audiodelays_reverb_obj_t *self) { @@ -157,13 +157,13 @@ void common_hal_audiodelays_reverb_set_damp(audiodelays_reverb_obj_t *self, mp_o } void audiodelays_reverb_get_damp_fixedpoint(mp_float_t n, int16_t *damp1, int16_t *damp2) { - if (n > (mp_float_t)MICROPY_FLOAT_CONST(1.0f)) { - n = MICROPY_FLOAT_CONST(1.0f); - } else if (n < (mp_float_t)MICROPY_FLOAT_CONST(0.0f)) { - n = MICROPY_FLOAT_CONST(0.0f); + if (n > (mp_float_t)MICROPY_FLOAT_CONST(1.0)) { + n = MICROPY_FLOAT_CONST(1.0); + } else if (n < (mp_float_t)MICROPY_FLOAT_CONST(0.0)) { + n = MICROPY_FLOAT_CONST(0.0); } - *damp1 = (int16_t)(n * (mp_float_t)MICROPY_FLOAT_CONST(13107.2f)); // 13107.2 = 0.4f scaling factor + *damp1 = (int16_t)(n * (mp_float_t)MICROPY_FLOAT_CONST(13107.2)); // 13107.2 = 0.4f scaling factor *damp2 = (int16_t)(32768 - *damp1); // inverse of x1 damp2 = 1.0 - damp1 } @@ -176,9 +176,9 @@ void common_hal_audiodelays_reverb_set_mix(audiodelays_reverb_obj_t *self, mp_ob } void audiodelays_reverb_get_mix_fixedpoint(mp_float_t mix, int16_t *mix_sample, int16_t *mix_effect) { - mix = mix * (mp_float_t)MICROPY_FLOAT_CONST(2.0f); - *mix_sample = (int16_t)MIN((mp_float_t)MICROPY_FLOAT_CONST(2.0f) - mix, (mp_float_t)MICROPY_FLOAT_CONST(1.0f)) * 32767; - *mix_effect = (int16_t)MIN(mix, (mp_float_t)MICROPY_FLOAT_CONST(1.0f)) * 32767; + mix = mix * (mp_float_t)MICROPY_FLOAT_CONST(2.0); + *mix_sample = (int16_t)MIN((mp_float_t)MICROPY_FLOAT_CONST(2.0) - mix, (mp_float_t)MICROPY_FLOAT_CONST(1.0)) * 32767; + *mix_effect = (int16_t)MIN(mix, (mp_float_t)MICROPY_FLOAT_CONST(1.0)) * 32767; } void audiodelays_reverb_reset_buffer(audiodelays_reverb_obj_t *self, From 6e7d2b5ddfadfd825fcd06ca4b014d4bc2e188f7 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Fri, 11 Apr 2025 16:36:06 -0500 Subject: [PATCH 12/24] Spelling mistake --- shared-bindings/audiodelays/Reverb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/audiodelays/Reverb.c b/shared-bindings/audiodelays/Reverb.c index bcd5c96382b57..5a7f9899f645b 100644 --- a/shared-bindings/audiodelays/Reverb.c +++ b/shared-bindings/audiodelays/Reverb.c @@ -148,7 +148,7 @@ MP_PROPERTY_GETSET(audiodelays_reverb_roomsize_obj, (mp_obj_t)&audiodelays_reverb_set_roomsize_obj); //| damp: synthio.BlockInput -//| """How reverbrent the area is. 0.0-1.0""" +//| """How much the high frequencies are dampened in the area. 0.0-1.0""" static mp_obj_t audiodelays_reverb_obj_get_damp(mp_obj_t self_in) { return common_hal_audiodelays_reverb_get_damp(self_in); } From 86eca385660a55187b0332c23fe362c029236991 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Fri, 11 Apr 2025 17:15:50 -0500 Subject: [PATCH 13/24] Moving to audiofreeverb and renaming to Freeverb --- py/circuitpy_defns.mk | 6 +- py/circuitpy_mpconfig.mk | 2 + shared-bindings/audiodelays/Reverb.h | 36 ---- shared-bindings/audiodelays/__init__.c | 2 - .../Reverb.c => audiofreeverb/Freeverb.c} | 160 +++++++++--------- shared-bindings/audiofreeverb/Freeverb.h | 36 ++++ shared-bindings/audiofreeverb/__init__.c | 34 ++++ shared-bindings/audiofreeverb/__init__.h | 7 + .../Reverb.c => audiofreeverb/Freeverb.c} | 58 +++---- .../Reverb.h => audiofreeverb/Freeverb.h} | 14 +- shared-module/audiofreeverb/__init__.c | 5 + shared-module/audiofreeverb/__init__.h | 7 + 12 files changed, 212 insertions(+), 155 deletions(-) delete mode 100644 shared-bindings/audiodelays/Reverb.h rename shared-bindings/{audiodelays/Reverb.c => audiofreeverb/Freeverb.c} (53%) create mode 100644 shared-bindings/audiofreeverb/Freeverb.h create mode 100644 shared-bindings/audiofreeverb/__init__.c create mode 100644 shared-bindings/audiofreeverb/__init__.h rename shared-module/{audiodelays/Reverb.c => audiofreeverb/Freeverb.c} (85%) rename shared-module/{audiodelays/Reverb.h => audiofreeverb/Freeverb.h} (67%) create mode 100644 shared-module/audiofreeverb/__init__.c create mode 100644 shared-module/audiofreeverb/__init__.h diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 150a5eb5a537b..ad0c098a448b9 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -137,6 +137,9 @@ endif ifeq ($(CIRCUITPY_AUDIOFILTERS),1) SRC_PATTERNS += audiofilters/% endif +ifeq ($(CIRCUITPY_AUDIOFREEVERB),1) +SRC_PATTERNS += audiofreeverb/% +endif ifeq ($(CIRCUITPY_AUDIOMIXER),1) SRC_PATTERNS += audiomixer/% endif @@ -633,11 +636,12 @@ SRC_SHARED_MODULE_ALL = \ audiocore/__init__.c \ audiodelays/Echo.c \ audiodelays/PitchShift.c \ - audiodelays/Reverb.c \ audiodelays/__init__.c \ audiofilters/Distortion.c \ audiofilters/Filter.c \ audiofilters/__init__.c \ + audiofreeverb/__init__.c \ + audiofreeverb/Freeverb.c \ audioio/__init__.c \ audiomixer/Mixer.c \ audiomixer/MixerVoice.c \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 831c1ec245fc3..d9e94b4bf084a 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -146,6 +146,8 @@ CIRCUITPY_AUDIODELAYS ?= $(CIRCUITPY_AUDIOEFFECTS) CFLAGS += -DCIRCUITPY_AUDIODELAYS=$(CIRCUITPY_AUDIODELAYS) CIRCUITPY_AUDIOFILTERS ?= $(CIRCUITPY_AUDIOEFFECTS) CFLAGS += -DCIRCUITPY_AUDIOFILTERS=$(CIRCUITPY_AUDIOFILTERS) +CIRCUITPY_AUDIOFREEVERB ?= $(CIRCUITPY_AUDIOEFFECTS) +CFLAGS += -DCIRCUITPY_AUDIOFREEVERB=$(CIRCUITPY_AUDIOFREEVERB) CIRCUITPY_AURORA_EPAPER ?= 0 CFLAGS += -DCIRCUITPY_AURORA_EPAPER=$(CIRCUITPY_AURORA_EPAPER) diff --git a/shared-bindings/audiodelays/Reverb.h b/shared-bindings/audiodelays/Reverb.h deleted file mode 100644 index 9c2ae570a3d35..0000000000000 --- a/shared-bindings/audiodelays/Reverb.h +++ /dev/null @@ -1,36 +0,0 @@ -// This file is part of the CircuitPython project: https://circuitpython.org -// -// SPDX-FileCopyrightText: Copyright (c) 2025 Mark Komus -// -// SPDX-License-Identifier: MIT - -#pragma once - -#include "shared-module/audiodelays/Reverb.h" - -extern const mp_obj_type_t audiodelays_reverb_type; - -void common_hal_audiodelays_reverb_construct(audiodelays_reverb_obj_t *self, - mp_obj_t roomsize, mp_obj_t damp, mp_obj_t mix, - uint32_t buffer_size, uint8_t bits_per_sample, bool samples_signed, - uint8_t channel_count, uint32_t sample_rate); - -void common_hal_audiodelays_reverb_deinit(audiodelays_reverb_obj_t *self); -bool common_hal_audiodelays_reverb_deinited(audiodelays_reverb_obj_t *self); - -uint32_t common_hal_audiodelays_reverb_get_sample_rate(audiodelays_reverb_obj_t *self); -uint8_t common_hal_audiodelays_reverb_get_channel_count(audiodelays_reverb_obj_t *self); -uint8_t common_hal_audiodelays_reverb_get_bits_per_sample(audiodelays_reverb_obj_t *self); - -mp_obj_t common_hal_audiodelays_reverb_get_roomsize(audiodelays_reverb_obj_t *self); -void common_hal_audiodelays_reverb_set_roomsize(audiodelays_reverb_obj_t *self, mp_obj_t feedback); - -mp_obj_t common_hal_audiodelays_reverb_get_damp(audiodelays_reverb_obj_t *self); -void common_hal_audiodelays_reverb_set_damp(audiodelays_reverb_obj_t *self, mp_obj_t damp); - -mp_obj_t common_hal_audiodelays_reverb_get_mix(audiodelays_reverb_obj_t *self); -void common_hal_audiodelays_reverb_set_mix(audiodelays_reverb_obj_t *self, mp_obj_t mix); - -bool common_hal_audiodelays_reverb_get_playing(audiodelays_reverb_obj_t *self); -void common_hal_audiodelays_reverb_play(audiodelays_reverb_obj_t *self, mp_obj_t sample, bool loop); -void common_hal_audiodelays_reverb_stop(audiodelays_reverb_obj_t *self); diff --git a/shared-bindings/audiodelays/__init__.c b/shared-bindings/audiodelays/__init__.c index 3c20661e2fe30..c0068a388e09c 100644 --- a/shared-bindings/audiodelays/__init__.c +++ b/shared-bindings/audiodelays/__init__.c @@ -12,7 +12,6 @@ #include "shared-bindings/audiodelays/__init__.h" #include "shared-bindings/audiodelays/Echo.h" #include "shared-bindings/audiodelays/PitchShift.h" -#include "shared-bindings/audiodelays/Reverb.h" //| """Support for audio delay effects @@ -25,7 +24,6 @@ static const mp_rom_map_elem_t audiodelays_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_audiodelays) }, { MP_ROM_QSTR(MP_QSTR_Echo), MP_ROM_PTR(&audiodelays_echo_type) }, { MP_ROM_QSTR(MP_QSTR_PitchShift), MP_ROM_PTR(&audiodelays_pitch_shift_type) }, - { MP_ROM_QSTR(MP_QSTR_Reverb), MP_ROM_PTR(&audiodelays_reverb_type) }, }; static MP_DEFINE_CONST_DICT(audiodelays_module_globals, audiodelays_module_globals_table); diff --git a/shared-bindings/audiodelays/Reverb.c b/shared-bindings/audiofreeverb/Freeverb.c similarity index 53% rename from shared-bindings/audiodelays/Reverb.c rename to shared-bindings/audiofreeverb/Freeverb.c index 5a7f9899f645b..62c9237a0d271 100644 --- a/shared-bindings/audiodelays/Reverb.c +++ b/shared-bindings/audiofreeverb/Freeverb.c @@ -6,9 +6,9 @@ #include -#include "shared-bindings/audiodelays/Reverb.h" +#include "shared-bindings/audiofreeverb/Freeverb.h" #include "shared-bindings/audiocore/__init__.h" -#include "shared-module/audiodelays/Reverb.h" +#include "shared-module/audiofreeverb/Freeverb.h" #include "shared/runtime/context_manager_helpers.h" #include "py/binary.h" @@ -17,8 +17,8 @@ #include "shared-bindings/util.h" #include "shared-module/synthio/block.h" -//| class Reverb: -//| """An Reverb effect""" +//| class Freeverb: +//| """An Freeverb effect""" //| //| def __init__( //| self, @@ -44,20 +44,20 @@ //| :param int buffer_size: The total size in bytes of each of the two playback buffers to use //| :param int sample_rate: The sample rate to be used //| :param int channel_count: The number of channels the source samples contain. 1 = mono; 2 = stereo. -//| :param int bits_per_sample: The bits per sample of the effect. Reverb requires 16 bits. -//| :param bool samples_signed: Effect is signed (True) or unsigned (False). Reverb requires signed (True). +//| :param int bits_per_sample: The bits per sample of the effect. Freeverb requires 16 bits. +//| :param bool samples_signed: Effect is signed (True) or unsigned (False). Freeverb requires signed (True). //| -//| Playing adding an reverb to a synth:: +//| Playing adding reverb to a synth:: //| //| import time //| import board //| import audiobusio //| import synthio -//| import audiodelays +//| import audiofreeverb //| //| audio = audiobusio.I2SOut(bit_clock=board.GP20, word_select=board.GP21, data=board.GP22) //| synth = synthio.Synthesizer(channel_count=1, sample_rate=44100) -//| reverb = audiodelays.Reverb(roomsize=0.7, damp=0.3, buffer_size=1024, channel_count=1, sample_rate=44100, mix=0.7) +//| reverb = audiofreeverb.Freeverb(roomsize=0.7, damp=0.3, buffer_size=1024, channel_count=1, sample_rate=44100, mix=0.7) //| reverb.play(synth) //| audio.play(reverb) //| @@ -69,7 +69,7 @@ //| time.sleep(5)""" //| ... //| -static mp_obj_t audiodelays_reverb_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { +static mp_obj_t audiofreeverb_freeverb_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { enum { ARG_roomsize, ARG_damp, ARG_mix, ARG_buffer_size, ARG_sample_rate, ARG_bits_per_sample, ARG_samples_signed, ARG_channel_count, }; static const mp_arg_t allowed_args[] = { { MP_QSTR_roomsize, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NULL} }, @@ -95,28 +95,28 @@ static mp_obj_t audiodelays_reverb_make_new(const mp_obj_type_t *type, size_t n_ mp_raise_ValueError(MP_ERROR_TEXT("bits_per_sample must be 16")); } - audiodelays_reverb_obj_t *self = mp_obj_malloc(audiodelays_reverb_obj_t, &audiodelays_reverb_type); - common_hal_audiodelays_reverb_construct(self, args[ARG_roomsize].u_obj, args[ARG_damp].u_obj, args[ARG_mix].u_obj, args[ARG_buffer_size].u_int, bits_per_sample, args[ARG_samples_signed].u_bool, channel_count, sample_rate); + audiofreeverb_freeverb_obj_t *self = mp_obj_malloc(audiofreeverb_freeverb_obj_t, &audiofreeverb_freeverb_type); + common_hal_audiofreeverb_freeverb_construct(self, args[ARG_roomsize].u_obj, args[ARG_damp].u_obj, args[ARG_mix].u_obj, args[ARG_buffer_size].u_int, bits_per_sample, args[ARG_samples_signed].u_bool, channel_count, sample_rate); return MP_OBJ_FROM_PTR(self); } //| def deinit(self) -> None: -//| """Deinitialises the Reverb.""" +//| """Deinitialises the Freeverb.""" //| ... //| -static mp_obj_t audiodelays_reverb_deinit(mp_obj_t self_in) { - audiodelays_reverb_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_audiodelays_reverb_deinit(self); +static mp_obj_t audiofreeverb_freeverb_deinit(mp_obj_t self_in) { + audiofreeverb_freeverb_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_audiofreeverb_freeverb_deinit(self); return mp_const_none; } -static MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_reverb_deinit_obj, audiodelays_reverb_deinit); +static MP_DEFINE_CONST_FUN_OBJ_1(audiofreeverb_freeverb_deinit_obj, audiofreeverb_freeverb_deinit); -static void check_for_deinit(audiodelays_reverb_obj_t *self) { +static void check_for_deinit(audiofreeverb_freeverb_obj_t *self) { audiosample_check_for_deinit(&self->base); } -//| def __enter__(self) -> Reverb: +//| def __enter__(self) -> Freeverb: //| """No-op used by Context Managers.""" //| ... //| @@ -131,70 +131,70 @@ static void check_for_deinit(audiodelays_reverb_obj_t *self) { //| roomsize: synthio.BlockInput //| """Apparent size of the room 0.0-1.0""" -static mp_obj_t audiodelays_reverb_obj_get_roomsize(mp_obj_t self_in) { - return common_hal_audiodelays_reverb_get_roomsize(self_in); +static mp_obj_t audiofreeverb_freeverb_obj_get_roomsize(mp_obj_t self_in) { + return common_hal_audiofreeverb_freeverb_get_roomsize(self_in); } -MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_reverb_get_roomsize_obj, audiodelays_reverb_obj_get_roomsize); +MP_DEFINE_CONST_FUN_OBJ_1(audiofreeverb_freeverb_get_roomsize_obj, audiofreeverb_freeverb_obj_get_roomsize); -static mp_obj_t audiodelays_reverb_obj_set_roomsize(mp_obj_t self_in, mp_obj_t roomsize) { - audiodelays_reverb_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_audiodelays_reverb_set_roomsize(self, roomsize); +static mp_obj_t audiofreeverb_freeverb_obj_set_roomsize(mp_obj_t self_in, mp_obj_t roomsize) { + audiofreeverb_freeverb_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_audiofreeverb_freeverb_set_roomsize(self, roomsize); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_2(audiodelays_reverb_set_roomsize_obj, audiodelays_reverb_obj_set_roomsize); +MP_DEFINE_CONST_FUN_OBJ_2(audiofreeverb_freeverb_set_roomsize_obj, audiofreeverb_freeverb_obj_set_roomsize); -MP_PROPERTY_GETSET(audiodelays_reverb_roomsize_obj, - (mp_obj_t)&audiodelays_reverb_get_roomsize_obj, - (mp_obj_t)&audiodelays_reverb_set_roomsize_obj); +MP_PROPERTY_GETSET(audiofreeverb_freeverb_roomsize_obj, + (mp_obj_t)&audiofreeverb_freeverb_get_roomsize_obj, + (mp_obj_t)&audiofreeverb_freeverb_set_roomsize_obj); //| damp: synthio.BlockInput //| """How much the high frequencies are dampened in the area. 0.0-1.0""" -static mp_obj_t audiodelays_reverb_obj_get_damp(mp_obj_t self_in) { - return common_hal_audiodelays_reverb_get_damp(self_in); +static mp_obj_t audiofreeverb_freeverb_obj_get_damp(mp_obj_t self_in) { + return common_hal_audiofreeverb_freeverb_get_damp(self_in); } -MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_reverb_get_damp_obj, audiodelays_reverb_obj_get_damp); +MP_DEFINE_CONST_FUN_OBJ_1(audiofreeverb_freeverb_get_damp_obj, audiofreeverb_freeverb_obj_get_damp); -static mp_obj_t audiodelays_reverb_obj_set_damp(mp_obj_t self_in, mp_obj_t damp) { - audiodelays_reverb_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_audiodelays_reverb_set_damp(self, damp); +static mp_obj_t audiofreeverb_freeverb_obj_set_damp(mp_obj_t self_in, mp_obj_t damp) { + audiofreeverb_freeverb_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_audiofreeverb_freeverb_set_damp(self, damp); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_2(audiodelays_reverb_set_damp_obj, audiodelays_reverb_obj_set_damp); +MP_DEFINE_CONST_FUN_OBJ_2(audiofreeverb_freeverb_set_damp_obj, audiofreeverb_freeverb_obj_set_damp); -MP_PROPERTY_GETSET(audiodelays_reverb_damp_obj, - (mp_obj_t)&audiodelays_reverb_get_damp_obj, - (mp_obj_t)&audiodelays_reverb_set_damp_obj); +MP_PROPERTY_GETSET(audiofreeverb_freeverb_damp_obj, + (mp_obj_t)&audiofreeverb_freeverb_get_damp_obj, + (mp_obj_t)&audiofreeverb_freeverb_set_damp_obj); //| mix: synthio.BlockInput //| """The rate the reverb mix between 0 and 1 where 0 is only sample and 1 is all effect.""" -static mp_obj_t audiodelays_reverb_obj_get_mix(mp_obj_t self_in) { - return common_hal_audiodelays_reverb_get_mix(self_in); +static mp_obj_t audiofreeverb_freeverb_obj_get_mix(mp_obj_t self_in) { + return common_hal_audiofreeverb_freeverb_get_mix(self_in); } -MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_reverb_get_mix_obj, audiodelays_reverb_obj_get_mix); +MP_DEFINE_CONST_FUN_OBJ_1(audiofreeverb_freeverb_get_mix_obj, audiofreeverb_freeverb_obj_get_mix); -static mp_obj_t audiodelays_reverb_obj_set_mix(mp_obj_t self_in, mp_obj_t mix_in) { - audiodelays_reverb_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_audiodelays_reverb_set_mix(self, mix_in); +static mp_obj_t audiofreeverb_freeverb_obj_set_mix(mp_obj_t self_in, mp_obj_t mix_in) { + audiofreeverb_freeverb_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_audiofreeverb_freeverb_set_mix(self, mix_in); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_2(audiodelays_reverb_set_mix_obj, audiodelays_reverb_obj_set_mix); +MP_DEFINE_CONST_FUN_OBJ_2(audiofreeverb_freeverb_set_mix_obj, audiofreeverb_freeverb_obj_set_mix); -MP_PROPERTY_GETSET(audiodelays_reverb_mix_obj, - (mp_obj_t)&audiodelays_reverb_get_mix_obj, - (mp_obj_t)&audiodelays_reverb_set_mix_obj); +MP_PROPERTY_GETSET(audiofreeverb_freeverb_mix_obj, + (mp_obj_t)&audiofreeverb_freeverb_get_mix_obj, + (mp_obj_t)&audiofreeverb_freeverb_set_mix_obj); //| playing: bool //| """True when the effect is playing a sample. (read-only)""" //| -static mp_obj_t audiodelays_reverb_obj_get_playing(mp_obj_t self_in) { - audiodelays_reverb_obj_t *self = MP_OBJ_TO_PTR(self_in); +static mp_obj_t audiofreeverb_freeverb_obj_get_playing(mp_obj_t self_in) { + audiofreeverb_freeverb_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); - return mp_obj_new_bool(common_hal_audiodelays_reverb_get_playing(self)); + return mp_obj_new_bool(common_hal_audiofreeverb_freeverb_get_playing(self)); } -MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_reverb_get_playing_obj, audiodelays_reverb_obj_get_playing); +MP_DEFINE_CONST_FUN_OBJ_1(audiofreeverb_freeverb_get_playing_obj, audiofreeverb_freeverb_obj_get_playing); -MP_PROPERTY_GETTER(audiodelays_reverb_playing_obj, - (mp_obj_t)&audiodelays_reverb_get_playing_obj); +MP_PROPERTY_GETTER(audiofreeverb_freeverb_playing_obj, + (mp_obj_t)&audiofreeverb_freeverb_get_playing_obj); //| def play(self, sample: circuitpython_typing.AudioSample, *, loop: bool = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. @@ -203,66 +203,66 @@ MP_PROPERTY_GETTER(audiodelays_reverb_playing_obj, //| The sample must match the encoding settings given in the constructor.""" //| ... //| -static mp_obj_t audiodelays_reverb_obj_play(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { +static mp_obj_t audiofreeverb_freeverb_obj_play(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_sample, ARG_loop }; static const mp_arg_t allowed_args[] = { { MP_QSTR_sample, MP_ARG_OBJ | MP_ARG_REQUIRED, {} }, { MP_QSTR_loop, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, }; - audiodelays_reverb_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + audiofreeverb_freeverb_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); check_for_deinit(self); mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); mp_obj_t sample = args[ARG_sample].u_obj; - common_hal_audiodelays_reverb_play(self, sample, args[ARG_loop].u_bool); + common_hal_audiofreeverb_freeverb_play(self, sample, args[ARG_loop].u_bool); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_KW(audiodelays_reverb_play_obj, 1, audiodelays_reverb_obj_play); +MP_DEFINE_CONST_FUN_OBJ_KW(audiofreeverb_freeverb_play_obj, 1, audiofreeverb_freeverb_obj_play); //| def stop(self) -> None: //| """Stops playback of the sample. The reverb continues playing.""" //| ... //| //| -static mp_obj_t audiodelays_reverb_obj_stop(mp_obj_t self_in) { - audiodelays_reverb_obj_t *self = MP_OBJ_TO_PTR(self_in); +static mp_obj_t audiofreeverb_freeverb_obj_stop(mp_obj_t self_in) { + audiofreeverb_freeverb_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_audiodelays_reverb_stop(self); + common_hal_audiofreeverb_freeverb_stop(self); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_reverb_stop_obj, audiodelays_reverb_obj_stop); +MP_DEFINE_CONST_FUN_OBJ_1(audiofreeverb_freeverb_stop_obj, audiofreeverb_freeverb_obj_stop); -static const mp_rom_map_elem_t audiodelays_reverb_locals_dict_table[] = { +static const mp_rom_map_elem_t audiofreeverb_freeverb_locals_dict_table[] = { // Methods - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&audiodelays_reverb_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&audiofreeverb_freeverb_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&default___exit___obj) }, - { MP_ROM_QSTR(MP_QSTR_play), MP_ROM_PTR(&audiodelays_reverb_play_obj) }, - { MP_ROM_QSTR(MP_QSTR_stop), MP_ROM_PTR(&audiodelays_reverb_stop_obj) }, + { MP_ROM_QSTR(MP_QSTR_play), MP_ROM_PTR(&audiofreeverb_freeverb_play_obj) }, + { MP_ROM_QSTR(MP_QSTR_stop), MP_ROM_PTR(&audiofreeverb_freeverb_stop_obj) }, // Properties - { MP_ROM_QSTR(MP_QSTR_playing), MP_ROM_PTR(&audiodelays_reverb_playing_obj) }, - { MP_ROM_QSTR(MP_QSTR_roomsize), MP_ROM_PTR(&audiodelays_reverb_roomsize_obj) }, - { MP_ROM_QSTR(MP_QSTR_damp), MP_ROM_PTR(&audiodelays_reverb_damp_obj) }, - { MP_ROM_QSTR(MP_QSTR_mix), MP_ROM_PTR(&audiodelays_reverb_mix_obj) }, + { MP_ROM_QSTR(MP_QSTR_playing), MP_ROM_PTR(&audiofreeverb_freeverb_playing_obj) }, + { MP_ROM_QSTR(MP_QSTR_roomsize), MP_ROM_PTR(&audiofreeverb_freeverb_roomsize_obj) }, + { MP_ROM_QSTR(MP_QSTR_damp), MP_ROM_PTR(&audiofreeverb_freeverb_damp_obj) }, + { MP_ROM_QSTR(MP_QSTR_mix), MP_ROM_PTR(&audiofreeverb_freeverb_mix_obj) }, AUDIOSAMPLE_FIELDS, }; -static MP_DEFINE_CONST_DICT(audiodelays_reverb_locals_dict, audiodelays_reverb_locals_dict_table); +static MP_DEFINE_CONST_DICT(audiofreeverb_freeverb_locals_dict, audiofreeverb_freeverb_locals_dict_table); -static const audiosample_p_t audiodelays_reverb_proto = { +static const audiosample_p_t audiofreeverb_freeverb_proto = { MP_PROTO_IMPLEMENT(MP_QSTR_protocol_audiosample) - .reset_buffer = (audiosample_reset_buffer_fun)audiodelays_reverb_reset_buffer, - .get_buffer = (audiosample_get_buffer_fun)audiodelays_reverb_get_buffer, + .reset_buffer = (audiosample_reset_buffer_fun)audiofreeverb_freeverb_reset_buffer, + .get_buffer = (audiosample_get_buffer_fun)audiofreeverb_freeverb_get_buffer, }; MP_DEFINE_CONST_OBJ_TYPE( - audiodelays_reverb_type, - MP_QSTR_Reverb, + audiofreeverb_freeverb_type, + MP_QSTR_freeverb, MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS, - make_new, audiodelays_reverb_make_new, - locals_dict, &audiodelays_reverb_locals_dict, - protocol, &audiodelays_reverb_proto + make_new, audiofreeverb_freeverb_make_new, + locals_dict, &audiofreeverb_freeverb_locals_dict, + protocol, &audiofreeverb_freeverb_proto ); diff --git a/shared-bindings/audiofreeverb/Freeverb.h b/shared-bindings/audiofreeverb/Freeverb.h new file mode 100644 index 0000000000000..913953ebecf62 --- /dev/null +++ b/shared-bindings/audiofreeverb/Freeverb.h @@ -0,0 +1,36 @@ +// This file is part of the CircuitPython project: https://circuitpython.org +// +// SPDX-FileCopyrightText: Copyright (c) 2025 Mark Komus +// +// SPDX-License-Identifier: MIT + +#pragma once + +#include "shared-module/audiofreeverb/Freeverb.h" + +extern const mp_obj_type_t audiofreeverb_freeverb_type; + +void common_hal_audiofreeverb_freeverb_construct(audiofreeverb_freeverb_obj_t *self, + mp_obj_t roomsize, mp_obj_t damp, mp_obj_t mix, + uint32_t buffer_size, uint8_t bits_per_sample, bool samples_signed, + uint8_t channel_count, uint32_t sample_rate); + +void common_hal_audiofreeverb_freeverb_deinit(audiofreeverb_freeverb_obj_t *self); +bool common_hal_audiofreeverb_freeverb_deinited(audiofreeverb_freeverb_obj_t *self); + +uint32_t common_hal_audiofreeverb_freeverb_get_sample_rate(audiofreeverb_freeverb_obj_t *self); +uint8_t common_hal_audiofreeverb_freeverb_get_channel_count(audiofreeverb_freeverb_obj_t *self); +uint8_t common_hal_audiofreeverb_freeverb_get_bits_per_sample(audiofreeverb_freeverb_obj_t *self); + +mp_obj_t common_hal_audiofreeverb_freeverb_get_roomsize(audiofreeverb_freeverb_obj_t *self); +void common_hal_audiofreeverb_freeverb_set_roomsize(audiofreeverb_freeverb_obj_t *self, mp_obj_t feedback); + +mp_obj_t common_hal_audiofreeverb_freeverb_get_damp(audiofreeverb_freeverb_obj_t *self); +void common_hal_audiofreeverb_freeverb_set_damp(audiofreeverb_freeverb_obj_t *self, mp_obj_t damp); + +mp_obj_t common_hal_audiofreeverb_freeverb_get_mix(audiofreeverb_freeverb_obj_t *self); +void common_hal_audiofreeverb_freeverb_set_mix(audiofreeverb_freeverb_obj_t *self, mp_obj_t mix); + +bool common_hal_audiofreeverb_freeverb_get_playing(audiofreeverb_freeverb_obj_t *self); +void common_hal_audiofreeverb_freeverb_play(audiofreeverb_freeverb_obj_t *self, mp_obj_t sample, bool loop); +void common_hal_audiofreeverb_freeverb_stop(audiofreeverb_freeverb_obj_t *self); diff --git a/shared-bindings/audiofreeverb/__init__.c b/shared-bindings/audiofreeverb/__init__.c new file mode 100644 index 0000000000000..cb8c979c8cfec --- /dev/null +++ b/shared-bindings/audiofreeverb/__init__.c @@ -0,0 +1,34 @@ +// This file is part of the CircuitPython project: https://circuitpython.org +// +// SPDX-FileCopyrightText: Copyright (c) 2024 Mark Komus +// +// SPDX-License-Identifier: MIT + +#include + +#include "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/audiofreeverb/__init__.h" +#include "shared-bindings/audiofreeverb/Freeverb.h" + + +//| """Support for audio freeverb effect +//| +//| The `audiofreeverb` module contains classes to provide access to audio freeverb effects. +//| +//| """ + +static const mp_rom_map_elem_t audiofreeverb_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_audiofreeverb) }, + { MP_ROM_QSTR(MP_QSTR_Freeverb), MP_ROM_PTR(&audiofreeverb_freeverb_type) }, +}; + +static MP_DEFINE_CONST_DICT(audiofreeverb_module_globals, audiofreeverb_module_globals_table); + +const mp_obj_module_t audiofreeverb_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t *)&audiofreeverb_module_globals, +}; + +MP_REGISTER_MODULE(MP_QSTR_audiofreeverb, audiofreeverb_module); diff --git a/shared-bindings/audiofreeverb/__init__.h b/shared-bindings/audiofreeverb/__init__.h new file mode 100644 index 0000000000000..66463561f5443 --- /dev/null +++ b/shared-bindings/audiofreeverb/__init__.h @@ -0,0 +1,7 @@ +// This file is part of the CircuitPython project: https://circuitpython.org +// +// SPDX-FileCopyrightText: Copyright (c) 2025 Mark Komus +// +// SPDX-License-Identifier: MIT + +#pragma once diff --git a/shared-module/audiodelays/Reverb.c b/shared-module/audiofreeverb/Freeverb.c similarity index 85% rename from shared-module/audiodelays/Reverb.c rename to shared-module/audiofreeverb/Freeverb.c index 81270a47a942f..0a1cd4fe5fd36 100644 --- a/shared-module/audiodelays/Reverb.c +++ b/shared-module/audiofreeverb/Freeverb.c @@ -7,13 +7,13 @@ // Based on FreeVerb - https://github.com/sinshu/freeverb/tree/main // Fixed point ideas from - Paul Stoffregen in the Teensy audio library https://github.com/PaulStoffregen/Audio/blob/master/effect_freeverb.cpp // -#include "shared-bindings/audiodelays/Reverb.h" +#include "shared-bindings/audiofreeverb/Freeverb.h" #include #include "py/runtime.h" #include -void common_hal_audiodelays_reverb_construct(audiodelays_reverb_obj_t *self, mp_obj_t roomsize, mp_obj_t damp, mp_obj_t mix, +void common_hal_audiofreeverb_freeverb_construct(audiofreeverb_freeverb_obj_t *self, mp_obj_t roomsize, mp_obj_t damp, mp_obj_t mix, uint32_t buffer_size, uint8_t bits_per_sample, bool samples_signed, uint8_t channel_count, uint32_t sample_rate) { @@ -35,14 +35,14 @@ void common_hal_audiodelays_reverb_construct(audiodelays_reverb_obj_t *self, mp_ self->buffer[0] = m_malloc(self->buffer_len); if (self->buffer[0] == NULL) { - common_hal_audiodelays_reverb_deinit(self); + common_hal_audiofreeverb_freeverb_deinit(self); m_malloc_fail(self->buffer_len); } memset(self->buffer[0], 0, self->buffer_len); self->buffer[1] = m_malloc(self->buffer_len); if (self->buffer[1] == NULL) { - common_hal_audiodelays_reverb_deinit(self); + common_hal_audiofreeverb_freeverb_deinit(self); m_malloc_fail(self->buffer_len); } memset(self->buffer[1], 0, self->buffer_len); @@ -61,19 +61,19 @@ void common_hal_audiodelays_reverb_construct(audiodelays_reverb_obj_t *self, mp_ roomsize = mp_obj_new_float(MICROPY_FLOAT_CONST(0.5)); } synthio_block_assign_slot(roomsize, &self->roomsize, MP_QSTR_roomsize); - common_hal_audiodelays_reverb_set_roomsize(self, roomsize); + common_hal_audiofreeverb_freeverb_set_roomsize(self, roomsize); if (damp == MP_OBJ_NULL) { damp = mp_obj_new_float(MICROPY_FLOAT_CONST(0.5)); } synthio_block_assign_slot(damp, &self->damp, MP_QSTR_damp); - common_hal_audiodelays_reverb_set_damp(self, damp); + common_hal_audiofreeverb_freeverb_set_damp(self, damp); if (mix == MP_OBJ_NULL) { mix = mp_obj_new_float(MICROPY_FLOAT_CONST(0.5)); } synthio_block_assign_slot(mix, &self->mix, MP_QSTR_mix); - common_hal_audiodelays_reverb_set_mix(self, mix); + common_hal_audiofreeverb_freeverb_set_mix(self, mix); // Set up the comb filters // These values come from FreeVerb and are selected for the best reverb sound @@ -88,7 +88,7 @@ void common_hal_audiodelays_reverb_construct(audiodelays_reverb_obj_t *self, mp_ for (uint32_t i = 0; i < 8 * channel_count; i++) { self->combbuffers[i] = m_malloc(self->combbuffersizes[i] * sizeof(uint16_t)); if (self->combbuffers[i] == NULL) { - common_hal_audiodelays_reverb_deinit(self); + common_hal_audiofreeverb_freeverb_deinit(self); m_malloc_fail(self->combbuffersizes[i]); } memset(self->combbuffers[i], 0, self->combbuffersizes[i]); @@ -106,7 +106,7 @@ void common_hal_audiodelays_reverb_construct(audiodelays_reverb_obj_t *self, mp_ for (uint32_t i = 0; i < 4 * channel_count; i++) { self->allpassbuffers[i] = m_malloc(self->allpassbuffersizes[i] * sizeof(uint16_t)); if (self->allpassbuffers[i] == NULL) { - common_hal_audiodelays_reverb_deinit(self); + common_hal_audiofreeverb_freeverb_deinit(self); m_malloc_fail(self->allpassbuffersizes[i]); } memset(self->allpassbuffers[i], 0, self->allpassbuffersizes[i]); @@ -115,30 +115,30 @@ void common_hal_audiodelays_reverb_construct(audiodelays_reverb_obj_t *self, mp_ } } -bool common_hal_audiodelays_reverb_deinited(audiodelays_reverb_obj_t *self) { +bool common_hal_audiofreeverb_freeverb_deinited(audiofreeverb_freeverb_obj_t *self) { if (self->buffer[0] == NULL) { return true; } return false; } -void common_hal_audiodelays_reverb_deinit(audiodelays_reverb_obj_t *self) { - if (common_hal_audiodelays_reverb_deinited(self)) { +void common_hal_audiofreeverb_freeverb_deinit(audiofreeverb_freeverb_obj_t *self) { + if (common_hal_audiofreeverb_freeverb_deinited(self)) { return; } self->buffer[0] = NULL; self->buffer[1] = NULL; } -mp_obj_t common_hal_audiodelays_reverb_get_roomsize(audiodelays_reverb_obj_t *self) { +mp_obj_t common_hal_audiofreeverb_freeverb_get_roomsize(audiofreeverb_freeverb_obj_t *self) { return self->roomsize.obj; } -void common_hal_audiodelays_reverb_set_roomsize(audiodelays_reverb_obj_t *self, mp_obj_t roomsize_obj) { +void common_hal_audiofreeverb_freeverb_set_roomsize(audiofreeverb_freeverb_obj_t *self, mp_obj_t roomsize_obj) { synthio_block_assign_slot(roomsize_obj, &self->roomsize, MP_QSTR_roomsize); } -int16_t audiodelays_reverb_get_roomsize_fixedpoint(mp_float_t n) { +int16_t audiofreeverb_freeverb_get_roomsize_fixedpoint(mp_float_t n) { if (n > (mp_float_t)MICROPY_FLOAT_CONST(1.0)) { n = MICROPY_FLOAT_CONST(1.0); } else if (n < (mp_float_t)MICROPY_FLOAT_CONST(0.0)) { @@ -148,15 +148,15 @@ int16_t audiodelays_reverb_get_roomsize_fixedpoint(mp_float_t n) { return (int16_t)(n * (mp_float_t)MICROPY_FLOAT_CONST(9175.04)) + 22937; // 9175.04 = 0.28f in fixed point 22937 = 0.7f } -mp_obj_t common_hal_audiodelays_reverb_get_damp(audiodelays_reverb_obj_t *self) { +mp_obj_t common_hal_audiofreeverb_freeverb_get_damp(audiofreeverb_freeverb_obj_t *self) { return self->damp.obj; } -void common_hal_audiodelays_reverb_set_damp(audiodelays_reverb_obj_t *self, mp_obj_t damp) { +void common_hal_audiofreeverb_freeverb_set_damp(audiofreeverb_freeverb_obj_t *self, mp_obj_t damp) { synthio_block_assign_slot(damp, &self->damp, MP_QSTR_damp); } -void audiodelays_reverb_get_damp_fixedpoint(mp_float_t n, int16_t *damp1, int16_t *damp2) { +void audiofreeverb_freeverb_get_damp_fixedpoint(mp_float_t n, int16_t *damp1, int16_t *damp2) { if (n > (mp_float_t)MICROPY_FLOAT_CONST(1.0)) { n = MICROPY_FLOAT_CONST(1.0); } else if (n < (mp_float_t)MICROPY_FLOAT_CONST(0.0)) { @@ -167,21 +167,21 @@ void audiodelays_reverb_get_damp_fixedpoint(mp_float_t n, int16_t *damp1, int16_ *damp2 = (int16_t)(32768 - *damp1); // inverse of x1 damp2 = 1.0 - damp1 } -mp_obj_t common_hal_audiodelays_reverb_get_mix(audiodelays_reverb_obj_t *self) { +mp_obj_t common_hal_audiofreeverb_freeverb_get_mix(audiofreeverb_freeverb_obj_t *self) { return self->mix.obj; } -void common_hal_audiodelays_reverb_set_mix(audiodelays_reverb_obj_t *self, mp_obj_t mix) { +void common_hal_audiofreeverb_freeverb_set_mix(audiofreeverb_freeverb_obj_t *self, mp_obj_t mix) { synthio_block_assign_slot(mix, &self->mix, MP_QSTR_mix); } -void audiodelays_reverb_get_mix_fixedpoint(mp_float_t mix, int16_t *mix_sample, int16_t *mix_effect) { +void audiofreeverb_freeverb_get_mix_fixedpoint(mp_float_t mix, int16_t *mix_sample, int16_t *mix_effect) { mix = mix * (mp_float_t)MICROPY_FLOAT_CONST(2.0); *mix_sample = (int16_t)MIN((mp_float_t)MICROPY_FLOAT_CONST(2.0) - mix, (mp_float_t)MICROPY_FLOAT_CONST(1.0)) * 32767; *mix_effect = (int16_t)MIN(mix, (mp_float_t)MICROPY_FLOAT_CONST(1.0)) * 32767; } -void audiodelays_reverb_reset_buffer(audiodelays_reverb_obj_t *self, +void audiofreeverb_freeverb_reset_buffer(audiofreeverb_freeverb_obj_t *self, bool single_channel_output, uint8_t channel) { @@ -189,11 +189,11 @@ void audiodelays_reverb_reset_buffer(audiodelays_reverb_obj_t *self, memset(self->buffer[1], 0, self->buffer_len); } -bool common_hal_audiodelays_reverb_get_playing(audiodelays_reverb_obj_t *self) { +bool common_hal_audiofreeverb_freeverb_get_playing(audiofreeverb_freeverb_obj_t *self) { return self->sample != NULL; } -void common_hal_audiodelays_reverb_play(audiodelays_reverb_obj_t *self, mp_obj_t sample, bool loop) { +void common_hal_audiofreeverb_freeverb_play(audiofreeverb_freeverb_obj_t *self, mp_obj_t sample, bool loop) { audiosample_must_match(&self->base, sample); self->sample = sample; @@ -210,7 +210,7 @@ void common_hal_audiodelays_reverb_play(audiodelays_reverb_obj_t *self, mp_obj_t return; } -void common_hal_audiodelays_reverb_stop(audiodelays_reverb_obj_t *self) { +void common_hal_audiofreeverb_freeverb_stop(audiofreeverb_freeverb_obj_t *self) { // When the sample is set to stop playing do any cleanup here // For reverb we clear the sample but the reverb continues until the object reading our effect stops self->sample = NULL; @@ -238,7 +238,7 @@ static int16_t sat16(int32_t n, int rshift) { return n; } -audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj_t *self, bool single_channel_output, uint8_t channel, +audioio_get_buffer_result_t audiofreeverb_freeverb_get_buffer(audiofreeverb_freeverb_obj_t *self, bool single_channel_output, uint8_t channel, uint8_t **buffer, uint32_t *buffer_length) { // Switch our buffers to the other buffer @@ -280,14 +280,14 @@ audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj shared_bindings_synthio_lfo_tick(self->base.sample_rate, n / self->base.channel_count); mp_float_t damp = synthio_block_slot_get_limited(&self->damp, MICROPY_FLOAT_CONST(0.0), MICROPY_FLOAT_CONST(1.0)); int16_t damp1, damp2; - audiodelays_reverb_get_damp_fixedpoint(damp, &damp1, &damp2); + audiofreeverb_freeverb_get_damp_fixedpoint(damp, &damp1, &damp2); mp_float_t mix = synthio_block_slot_get_limited(&self->mix, MICROPY_FLOAT_CONST(0.0), MICROPY_FLOAT_CONST(1.0)); int16_t mix_sample, mix_effect; - audiodelays_reverb_get_mix_fixedpoint(mix, &mix_sample, &mix_effect); + audiofreeverb_freeverb_get_mix_fixedpoint(mix, &mix_sample, &mix_effect); mp_float_t roomsize = synthio_block_slot_get_limited(&self->roomsize, MICROPY_FLOAT_CONST(0.0), MICROPY_FLOAT_CONST(1.0)); - int16_t feedback = audiodelays_reverb_get_roomsize_fixedpoint(roomsize); + int16_t feedback = audiofreeverb_freeverb_get_roomsize_fixedpoint(roomsize); int16_t *sample_src = (int16_t *)self->sample_remaining_buffer; diff --git a/shared-module/audiodelays/Reverb.h b/shared-module/audiofreeverb/Freeverb.h similarity index 67% rename from shared-module/audiodelays/Reverb.h rename to shared-module/audiofreeverb/Freeverb.h index 0ce2d5bad2099..44747f0fc951d 100644 --- a/shared-module/audiodelays/Reverb.h +++ b/shared-module/audiofreeverb/Freeverb.h @@ -11,7 +11,7 @@ #include "shared-module/synthio/__init__.h" #include "shared-module/synthio/block.h" -extern const mp_obj_type_t audiodelays_reverb_type; +extern const mp_obj_type_t audiofreeverb_freeverb_type; typedef struct { audiosample_base_t base; @@ -39,18 +39,18 @@ typedef struct { int16_t allpassbufferindex[8]; mp_obj_t sample; -} audiodelays_reverb_obj_t; +} audiofreeverb_freeverb_obj_t; -void audiodelays_reverb_reset_buffer(audiodelays_reverb_obj_t *self, +void audiofreeverb_freeverb_reset_buffer(audiofreeverb_freeverb_obj_t *self, bool single_channel_output, uint8_t channel); -audioio_get_buffer_result_t audiodelays_reverb_get_buffer(audiodelays_reverb_obj_t *self, +audioio_get_buffer_result_t audiofreeverb_freeverb_get_buffer(audiofreeverb_freeverb_obj_t *self, bool single_channel_output, uint8_t channel, uint8_t **buffer, uint32_t *buffer_length); // length in bytes -int16_t audiodelays_reverb_get_roomsize_fixedpoint(mp_float_t n); -void audiodelays_reverb_get_damp_fixedpoint(mp_float_t n, int16_t *damp1, int16_t *damp2); -void audiodelays_reverb_get_mix_fixedpoint(mp_float_t mix, int16_t *mix_sample, int16_t *mix_effect); +int16_t audiofreeverb_freeverb_get_roomsize_fixedpoint(mp_float_t n); +void audiofreeverb_freeverb_get_damp_fixedpoint(mp_float_t n, int16_t *damp1, int16_t *damp2); +void audiofreeverb_freeverb_get_mix_fixedpoint(mp_float_t mix, int16_t *mix_sample, int16_t *mix_effect); diff --git a/shared-module/audiofreeverb/__init__.c b/shared-module/audiofreeverb/__init__.c new file mode 100644 index 0000000000000..94cd4caa3bd1b --- /dev/null +++ b/shared-module/audiofreeverb/__init__.c @@ -0,0 +1,5 @@ +// This file is part of the CircuitPython project: https://circuitpython.org +// +// SPDX-FileCopyrightText: Copyright (c) 2025 Mark Komus +// +// SPDX-License-Identifier: MIT diff --git a/shared-module/audiofreeverb/__init__.h b/shared-module/audiofreeverb/__init__.h new file mode 100644 index 0000000000000..66463561f5443 --- /dev/null +++ b/shared-module/audiofreeverb/__init__.h @@ -0,0 +1,7 @@ +// This file is part of the CircuitPython project: https://circuitpython.org +// +// SPDX-FileCopyrightText: Copyright (c) 2025 Mark Komus +// +// SPDX-License-Identifier: MIT + +#pragma once From c9a2a4032977ce0cf6ebdef72cb56aba8507a1af Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Fri, 11 Apr 2025 17:39:33 -0500 Subject: [PATCH 14/24] Fix the mix calculation --- shared-module/audiofreeverb/Freeverb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-module/audiofreeverb/Freeverb.c b/shared-module/audiofreeverb/Freeverb.c index 0a1cd4fe5fd36..ea2d3dfbc9efe 100644 --- a/shared-module/audiofreeverb/Freeverb.c +++ b/shared-module/audiofreeverb/Freeverb.c @@ -177,8 +177,8 @@ void common_hal_audiofreeverb_freeverb_set_mix(audiofreeverb_freeverb_obj_t *sel void audiofreeverb_freeverb_get_mix_fixedpoint(mp_float_t mix, int16_t *mix_sample, int16_t *mix_effect) { mix = mix * (mp_float_t)MICROPY_FLOAT_CONST(2.0); - *mix_sample = (int16_t)MIN((mp_float_t)MICROPY_FLOAT_CONST(2.0) - mix, (mp_float_t)MICROPY_FLOAT_CONST(1.0)) * 32767; - *mix_effect = (int16_t)MIN(mix, (mp_float_t)MICROPY_FLOAT_CONST(1.0)) * 32767; + *mix_sample = (int16_t)(MIN((mp_float_t)MICROPY_FLOAT_CONST(2.0) - mix, (mp_float_t)MICROPY_FLOAT_CONST(1.0)) * 32767); + *mix_effect = (int16_t)(MIN(mix, (mp_float_t)MICROPY_FLOAT_CONST(1.0)) * 32767); } void audiofreeverb_freeverb_reset_buffer(audiofreeverb_freeverb_obj_t *self, From 168b16de512f32fa058dfb4e9c2c167fa5d79c43 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Fri, 11 Apr 2025 17:41:51 -0500 Subject: [PATCH 15/24] Rename unix build pathes --- ports/unix/variants/coverage/mpconfigvariant.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ports/unix/variants/coverage/mpconfigvariant.mk b/ports/unix/variants/coverage/mpconfigvariant.mk index b288c15fdc140..4e036e6b6d6cf 100644 --- a/ports/unix/variants/coverage/mpconfigvariant.mk +++ b/ports/unix/variants/coverage/mpconfigvariant.mk @@ -35,11 +35,12 @@ SRC_BITMAP := \ shared-bindings/audiocore/WaveFile.c \ shared-bindings/audiodelays/Echo.c \ shared-bindings/audiodelays/PitchShift.c \ - shared-bindings/audiodelays/Reverb.c \ shared-bindings/audiodelays/__init__.c \ shared-bindings/audiofilters/Distortion.c \ shared-bindings/audiofilters/Filter.c \ shared-bindings/audiofilters/__init__.c \ + shared-bindings/audiofreeverb/Freeverb.c \ + shared-bindings/audiofreeverb/__init__.c \ shared-bindings/audiomixer/__init__.c \ shared-bindings/audiomixer/Mixer.c \ shared-bindings/audiomixer/MixerVoice.c \ @@ -80,11 +81,12 @@ SRC_BITMAP := \ shared-module/audiocore/WaveFile.c \ shared-module/audiodelays/Echo.c \ shared-module/audiodelays/PitchShift.c \ - shared-module/audiodelays/Reverb.c \ shared-module/audiodelays/__init__.c \ shared-module/audiofilters/Distortion.c \ shared-module/audiofilters/Filter.c \ shared-module/audiofilters/__init__.c \ + shared-module/audiofreeverb/Freeverb.c \ + shared-module/audiofreeverb/__init__.c \ shared-module/audiomixer/__init__.c \ shared-module/audiomp3/MP3Decoder.c \ shared-module/audiomixer/Mixer.c \ From f011df26faa3a4a083e116637c323d50d48b6d50 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 19 Apr 2025 09:51:02 -0500 Subject: [PATCH 16/24] Fixes for zephyr build --- .../nordic/nrf5340dk/autogen_board_info.toml | 22 +++++++++++++++++++ .../nordic/nrf54l15dk/autogen_board_info.toml | 22 +++++++++++++++++++ .../nordic/nrf7002dk/autogen_board_info.toml | 22 +++++++++++++++++++ .../renesas/ek_ra6m5/autogen_board_info.toml | 22 +++++++++++++++++++ .../renesas/ek_ra8d1/autogen_board_info.toml | 22 +++++++++++++++++++ .../nucleo_u575zi_q/autogen_board_info.toml | 22 +++++++++++++++++++ .../st/stm32h7b3i_dk/autogen_board_info.toml | 22 +++++++++++++++++++ shared-bindings/audiodelays/__init__.c | 1 - shared-module/audiofreeverb/Freeverb.c | 8 +++---- 9 files changed, 158 insertions(+), 5 deletions(-) diff --git a/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml index ba0291f64300a..5a8b37790d3c9 100644 --- a/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml @@ -6,8 +6,10 @@ __future__ = false _bleio = false _eve = false _pew = false +_pixelbuf = false _pixelmap = false _stage = false +_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -19,6 +21,7 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false +audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -33,23 +36,33 @@ busdisplay = false busio = false camera = false canio = false +circuitpython_typing = false codeop = false countio = false +cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false +gamepad = false +gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false +i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -65,11 +78,15 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false +multiterminal = false neopixel_write = false +network = false nvm = false onewireio = false os = true +paralleldisplay = false paralleldisplaybus = false +picodvi = false ps2io = false pulseio = false pwmio = false @@ -78,10 +95,13 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false +rp2pio = false rtc = false +samd = false sdcardio = false sdioio = false sharpdisplay = false +socket = false socketpool = false spitarget = false ssl = false @@ -95,6 +115,7 @@ time = true touchio = false traceback = false uheap = false +ulab = false usb = false usb_cdc = true usb_hid = false @@ -106,6 +127,7 @@ vectorio = false warnings = false watchdog = false wifi = false +wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml index 88178af3b28c2..847c676389e78 100644 --- a/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml @@ -6,8 +6,10 @@ __future__ = false _bleio = false _eve = false _pew = false +_pixelbuf = false _pixelmap = false _stage = false +_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -19,6 +21,7 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false +audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -33,23 +36,33 @@ busdisplay = false busio = false camera = false canio = false +circuitpython_typing = false codeop = false countio = false +cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false +gamepad = false +gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false +i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -65,11 +78,15 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false +multiterminal = false neopixel_write = false +network = false nvm = false onewireio = false os = true +paralleldisplay = false paralleldisplaybus = false +picodvi = false ps2io = false pulseio = false pwmio = false @@ -78,10 +95,13 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false +rp2pio = false rtc = false +samd = false sdcardio = false sdioio = false sharpdisplay = false +socket = false socketpool = false spitarget = false ssl = false @@ -95,6 +115,7 @@ time = true touchio = false traceback = false uheap = false +ulab = false usb = false usb_cdc = false usb_hid = false @@ -106,6 +127,7 @@ vectorio = false warnings = false watchdog = false wifi = false +wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml index 85b5a9c7e0fad..a1876eb36a842 100644 --- a/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml @@ -6,8 +6,10 @@ __future__ = false _bleio = false _eve = false _pew = false +_pixelbuf = false _pixelmap = false _stage = false +_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -19,6 +21,7 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false +audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -33,23 +36,33 @@ busdisplay = false busio = false camera = false canio = false +circuitpython_typing = false codeop = false countio = false +cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false +gamepad = false +gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false +i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -65,11 +78,15 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false +multiterminal = false neopixel_write = false +network = false nvm = false onewireio = false os = true +paralleldisplay = false paralleldisplaybus = false +picodvi = false ps2io = false pulseio = false pwmio = false @@ -78,10 +95,13 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false +rp2pio = false rtc = false +samd = false sdcardio = false sdioio = false sharpdisplay = false +socket = false socketpool = true # Zephyr networking enabled spitarget = false ssl = true # Zephyr networking enabled @@ -95,6 +115,7 @@ time = true touchio = false traceback = false uheap = false +ulab = false usb = false usb_cdc = true usb_hid = false @@ -106,6 +127,7 @@ vectorio = false warnings = false watchdog = false wifi = true # Zephyr board has wifi +wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml b/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml index 674a19ab107c9..251f0461a7622 100644 --- a/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml @@ -6,8 +6,10 @@ __future__ = false _bleio = false _eve = false _pew = false +_pixelbuf = false _pixelmap = false _stage = false +_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -19,6 +21,7 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false +audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -33,23 +36,33 @@ busdisplay = false busio = false camera = false canio = false +circuitpython_typing = false codeop = false countio = false +cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false +gamepad = false +gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false +i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -65,11 +78,15 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false +multiterminal = false neopixel_write = false +network = false nvm = false onewireio = false os = true +paralleldisplay = false paralleldisplaybus = false +picodvi = false ps2io = false pulseio = false pwmio = false @@ -78,10 +95,13 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false +rp2pio = false rtc = false +samd = false sdcardio = false sdioio = false sharpdisplay = false +socket = false socketpool = false spitarget = false ssl = false @@ -95,6 +115,7 @@ time = true touchio = false traceback = false uheap = false +ulab = false usb = false usb_cdc = false # No TinyUSB settings for r7fa6m5bh3cfc usb_hid = false @@ -106,6 +127,7 @@ vectorio = false warnings = false watchdog = false wifi = false +wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml b/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml index 4f920c59f11d9..e467d211bde86 100644 --- a/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml @@ -6,8 +6,10 @@ __future__ = false _bleio = false _eve = false _pew = false +_pixelbuf = false _pixelmap = false _stage = false +_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -19,6 +21,7 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false +audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -33,23 +36,33 @@ busdisplay = false busio = false camera = false canio = false +circuitpython_typing = false codeop = false countio = false +cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false +gamepad = false +gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false +i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -65,11 +78,15 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false +multiterminal = false neopixel_write = false +network = false nvm = false onewireio = false os = true +paralleldisplay = false paralleldisplaybus = false +picodvi = false ps2io = false pulseio = false pwmio = false @@ -78,10 +95,13 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false +rp2pio = false rtc = false +samd = false sdcardio = false sdioio = false sharpdisplay = false +socket = false socketpool = false spitarget = false ssl = false @@ -95,6 +115,7 @@ time = true touchio = false traceback = false uheap = false +ulab = false usb = false usb_cdc = false # No TinyUSB settings for r7fa8d1bhecbd usb_hid = false @@ -106,6 +127,7 @@ vectorio = false warnings = false watchdog = false wifi = false +wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml b/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml index 000155eafa744..fe2c72787bcec 100644 --- a/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml @@ -6,8 +6,10 @@ __future__ = false _bleio = false _eve = false _pew = false +_pixelbuf = false _pixelmap = false _stage = false +_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -19,6 +21,7 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false +audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -33,23 +36,33 @@ busdisplay = false busio = false camera = false canio = false +circuitpython_typing = false codeop = false countio = false +cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false +gamepad = false +gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false +i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -65,11 +78,15 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false +multiterminal = false neopixel_write = false +network = false nvm = false onewireio = false os = true +paralleldisplay = false paralleldisplaybus = false +picodvi = false ps2io = false pulseio = false pwmio = false @@ -78,10 +95,13 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false +rp2pio = false rtc = false +samd = false sdcardio = false sdioio = false sharpdisplay = false +socket = false socketpool = false spitarget = false ssl = false @@ -95,6 +115,7 @@ time = true touchio = false traceback = false uheap = false +ulab = false usb = false usb_cdc = true usb_hid = false @@ -106,6 +127,7 @@ vectorio = false warnings = false watchdog = false wifi = false +wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml b/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml index ac0aff61a59c3..0eb1b5a17c61d 100644 --- a/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml @@ -6,8 +6,10 @@ __future__ = false _bleio = false _eve = false _pew = false +_pixelbuf = false _pixelmap = false _stage = false +_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -19,6 +21,7 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false +audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -33,23 +36,33 @@ busdisplay = false busio = false camera = false canio = false +circuitpython_typing = false codeop = false countio = false +cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false +gamepad = false +gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false +i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -65,11 +78,15 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false +multiterminal = false neopixel_write = false +network = false nvm = false onewireio = false os = true +paralleldisplay = false paralleldisplaybus = false +picodvi = false ps2io = false pulseio = false pwmio = false @@ -78,10 +95,13 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false +rp2pio = false rtc = false +samd = false sdcardio = false sdioio = false sharpdisplay = false +socket = false socketpool = false spitarget = false ssl = false @@ -95,6 +115,7 @@ time = true touchio = false traceback = false uheap = false +ulab = false usb = false usb_cdc = false usb_hid = false @@ -106,6 +127,7 @@ vectorio = false warnings = false watchdog = false wifi = false +wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false diff --git a/shared-bindings/audiodelays/__init__.c b/shared-bindings/audiodelays/__init__.c index c0068a388e09c..58cb9dc70a879 100644 --- a/shared-bindings/audiodelays/__init__.c +++ b/shared-bindings/audiodelays/__init__.c @@ -13,7 +13,6 @@ #include "shared-bindings/audiodelays/Echo.h" #include "shared-bindings/audiodelays/PitchShift.h" - //| """Support for audio delay effects //| //| The `audiodelays` module contains classes to provide access to audio delay effects. diff --git a/shared-module/audiofreeverb/Freeverb.c b/shared-module/audiofreeverb/Freeverb.c index ea2d3dfbc9efe..d5c4671595e1c 100644 --- a/shared-module/audiofreeverb/Freeverb.c +++ b/shared-module/audiofreeverb/Freeverb.c @@ -33,14 +33,14 @@ void common_hal_audiofreeverb_freeverb_construct(audiofreeverb_freeverb_obj_t *s // Samples are set sequentially. For stereo audio they are passed L/R/L/R/... self->buffer_len = buffer_size; // in bytes - self->buffer[0] = m_malloc(self->buffer_len); + self->buffer[0] = m_malloc_maybe(self->buffer_len); if (self->buffer[0] == NULL) { common_hal_audiofreeverb_freeverb_deinit(self); m_malloc_fail(self->buffer_len); } memset(self->buffer[0], 0, self->buffer_len); - self->buffer[1] = m_malloc(self->buffer_len); + self->buffer[1] = m_malloc_maybe(self->buffer_len); if (self->buffer[1] == NULL) { common_hal_audiofreeverb_freeverb_deinit(self); m_malloc_fail(self->buffer_len); @@ -86,7 +86,7 @@ void common_hal_audiofreeverb_freeverb_construct(audiofreeverb_freeverb_obj_t *s self->combbuffersizes[6] = self->combbuffersizes[14] = 1557; self->combbuffersizes[7] = self->combbuffersizes[15] = 1617; for (uint32_t i = 0; i < 8 * channel_count; i++) { - self->combbuffers[i] = m_malloc(self->combbuffersizes[i] * sizeof(uint16_t)); + self->combbuffers[i] = m_malloc_maybe(self->combbuffersizes[i] * sizeof(uint16_t)); if (self->combbuffers[i] == NULL) { common_hal_audiofreeverb_freeverb_deinit(self); m_malloc_fail(self->combbuffersizes[i]); @@ -104,7 +104,7 @@ void common_hal_audiofreeverb_freeverb_construct(audiofreeverb_freeverb_obj_t *s self->allpassbuffersizes[2] = self->allpassbuffersizes[6] = 341; self->allpassbuffersizes[3] = self->allpassbuffersizes[7] = 225; for (uint32_t i = 0; i < 4 * channel_count; i++) { - self->allpassbuffers[i] = m_malloc(self->allpassbuffersizes[i] * sizeof(uint16_t)); + self->allpassbuffers[i] = m_malloc_maybe(self->allpassbuffersizes[i] * sizeof(uint16_t)); if (self->allpassbuffers[i] == NULL) { common_hal_audiofreeverb_freeverb_deinit(self); m_malloc_fail(self->allpassbuffersizes[i]); From 4b7d9c5606d06ff2f550441f1107883860178ab8 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 19 Apr 2025 10:05:06 -0500 Subject: [PATCH 17/24] Add zephyr script --- ports/zephyr-cp/cptools/update_board_info.py | 101 +++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100755 ports/zephyr-cp/cptools/update_board_info.py diff --git a/ports/zephyr-cp/cptools/update_board_info.py b/ports/zephyr-cp/cptools/update_board_info.py new file mode 100755 index 0000000000000..935fc07c17d3a --- /dev/null +++ b/ports/zephyr-cp/cptools/update_board_info.py @@ -0,0 +1,101 @@ +#!/usr/bin/env python3 + +import pathlib +import sys +import tomlkit + + +def find_modules(top_dir, port_dir): + """Find all available modules in shared-bindings and port bindings.""" + modules = set() + for module in sorted( + list(top_dir.glob("shared-bindings/*")) + list(port_dir.glob("bindings/*")), + key=lambda x: x.name, + ): + if not module.is_dir(): + continue + modules.add(module.name) + return sorted(modules) + + +def find_board_info_files(port_dir): + """Find all autogen_board_info.toml files in the port directory.""" + return list(port_dir.glob("boards/**/autogen_board_info.toml")) + + +def update_board_info(board_info_path, available_modules): + """Update board info file with new modules set to false.""" + if not board_info_path.exists(): + print(f"Error: Board info file {board_info_path} does not exist", file=sys.stderr) + return False + + # Load existing board info + with open(board_info_path, "r", encoding="utf-8") as f: + board_info = tomlkit.load(f) + + # Get current modules + current_modules = set(board_info.get("modules", {})) + + # Find new modules + new_modules = set(available_modules) - current_modules + if not new_modules: + print( + f"No new modules found for {board_info_path.relative_to(board_info_path.parents[3])}" + ) + return True + + # Add new modules as disabled in alphabetical order + modules_table = board_info["modules"] + # Get all modules (existing and new) and sort them + all_modules = list(current_modules | new_modules) + all_modules.sort() + + # Create a new table with sorted modules + sorted_table = tomlkit.table() + for module in all_modules: + if module in modules_table: + # TODO: Use modules_table.item once tomlkit is released with changes from January 2025 + sorted_table[module] = modules_table._value.item(module) + else: + sorted_table[module] = tomlkit.item(False) + + # Replace the modules table with the sorted one + board_info["modules"] = sorted_table + + # Write updated board info + with open(board_info_path, "w", encoding="utf-8") as f: + tomlkit.dump(board_info, f) + + print( + f"Updated {board_info_path.relative_to(board_info_path.parents[3])} with {len(new_modules)} new modules:" + ) + for module in sorted(new_modules): + print(f" - {module}") + return True + + +def main(): + # Get repo paths + script_dir = pathlib.Path(__file__).parent + top_dir = script_dir.parents[2] # circuitpython root + port_dir = script_dir.parent # zephyr-cp directory + + # Get available modules once + available_modules = find_modules(top_dir, port_dir) + + # Update all board info files + board_info_files = find_board_info_files(port_dir) + if not board_info_files: + print("No board info files found") + sys.exit(1) + + success = True + for board_info_path in board_info_files: + if not update_board_info(board_info_path, available_modules): + success = False + + sys.exit(0 if success else 1) + + +if __name__ == "__main__": + main() From fa863cf695a5a46a92015dee66cd4c07273bd758 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 19 Apr 2025 14:09:55 -0500 Subject: [PATCH 18/24] Removing autogen files --- .../nordic/nrf5340dk/autogen_board_info.toml | 133 ------------------ .../nordic/nrf54l15dk/autogen_board_info.toml | 133 ------------------ .../nordic/nrf7002dk/autogen_board_info.toml | 133 ------------------ .../renesas/ek_ra6m5/autogen_board_info.toml | 133 ------------------ .../renesas/ek_ra8d1/autogen_board_info.toml | 133 ------------------ .../nucleo_u575zi_q/autogen_board_info.toml | 133 ------------------ .../st/stm32h7b3i_dk/autogen_board_info.toml | 133 ------------------ 7 files changed, 931 deletions(-) delete mode 100644 ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml delete mode 100644 ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml delete mode 100644 ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml delete mode 100644 ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml delete mode 100644 ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml delete mode 100644 ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml delete mode 100644 ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml diff --git a/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml deleted file mode 100644 index 5a8b37790d3c9..0000000000000 --- a/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml +++ /dev/null @@ -1,133 +0,0 @@ -# This file is autogenerated when a board is built. Do not edit. Do commit it to git. Other scripts use its info. -name = "Nordic Semiconductor nRF5340 DK" - -[modules] -__future__ = false -_bleio = false -_eve = false -_pew = false -_pixelbuf = false -_pixelmap = false -_stage = false -_typing = false -adafruit_bus_device = false -adafruit_pixelbuf = false -aesio = false -alarm = false -analogbufio = false -analogio = false -atexit = false -audiobusio = false -audiocore = false -audiodelays = false -audiofilters = false -audiofreeverb = false -audioio = false -audiomixer = false -audiomp3 = false -audiopwmio = false -aurora_epaper = false -bitbangio = false -bitmapfilter = false -bitmaptools = false -bitops = false -board = false -busdisplay = false -busio = false -camera = false -canio = false -circuitpython_typing = false -codeop = false -countio = false -cyw43 = false -digitalio = true -displayio = false -dotclockframebuffer = false -dualbank = false -epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false -floppyio = false -fontio = false -fourwire = false -framebufferio = false -frequencyio = false -gamepad = false -gamepadshift = false -getpass = false -gifio = false -gnss = false -hashlib = false -i2cdisplaybus = false -i2cperipheral = false -i2ctarget = false -imagecapture = false -ipaddress = false -is31fl3741 = false -jpegio = false -keypad = false -keypad_demux = false -locale = false -math = false -max3421e = false -mdns = false -memorymap = false -memorymonitor = false -microcontroller = true -msgpack = false -multiterminal = false -neopixel_write = false -network = false -nvm = false -onewireio = false -os = true -paralleldisplay = false -paralleldisplaybus = false -picodvi = false -ps2io = false -pulseio = false -pwmio = false -qrio = false -rainbowio = false -random = true -rgbmatrix = false -rotaryio = false -rp2pio = false -rtc = false -samd = false -sdcardio = false -sdioio = false -sharpdisplay = false -socket = false -socketpool = false -spitarget = false -ssl = false -storage = true # Zephyr board has flash -struct = true -supervisor = false -synthio = false -terminalio = false -tilepalettemapper = false -time = true -touchio = false -traceback = false -uheap = false -ulab = false -usb = false -usb_cdc = true -usb_hid = false -usb_host = false -usb_midi = false -usb_video = false -ustack = false -vectorio = false -warnings = false -watchdog = false -wifi = false -wiznet = false -zephyr_kernel = false -zephyr_serial = true -zlib = false diff --git a/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml deleted file mode 100644 index 847c676389e78..0000000000000 --- a/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml +++ /dev/null @@ -1,133 +0,0 @@ -# This file is autogenerated when a board is built. Do not edit. Do commit it to git. Other scripts use its info. -name = "Nordic Semiconductor nRF54L15 DK" - -[modules] -__future__ = false -_bleio = false -_eve = false -_pew = false -_pixelbuf = false -_pixelmap = false -_stage = false -_typing = false -adafruit_bus_device = false -adafruit_pixelbuf = false -aesio = false -alarm = false -analogbufio = false -analogio = false -atexit = false -audiobusio = false -audiocore = false -audiodelays = false -audiofilters = false -audiofreeverb = false -audioio = false -audiomixer = false -audiomp3 = false -audiopwmio = false -aurora_epaper = false -bitbangio = false -bitmapfilter = false -bitmaptools = false -bitops = false -board = false -busdisplay = false -busio = false -camera = false -canio = false -circuitpython_typing = false -codeop = false -countio = false -cyw43 = false -digitalio = true -displayio = false -dotclockframebuffer = false -dualbank = false -epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false -floppyio = false -fontio = false -fourwire = false -framebufferio = false -frequencyio = false -gamepad = false -gamepadshift = false -getpass = false -gifio = false -gnss = false -hashlib = false -i2cdisplaybus = false -i2cperipheral = false -i2ctarget = false -imagecapture = false -ipaddress = false -is31fl3741 = false -jpegio = false -keypad = false -keypad_demux = false -locale = false -math = false -max3421e = false -mdns = false -memorymap = false -memorymonitor = false -microcontroller = true -msgpack = false -multiterminal = false -neopixel_write = false -network = false -nvm = false -onewireio = false -os = true -paralleldisplay = false -paralleldisplaybus = false -picodvi = false -ps2io = false -pulseio = false -pwmio = false -qrio = false -rainbowio = false -random = true -rgbmatrix = false -rotaryio = false -rp2pio = false -rtc = false -samd = false -sdcardio = false -sdioio = false -sharpdisplay = false -socket = false -socketpool = false -spitarget = false -ssl = false -storage = true # Zephyr board has flash -struct = true -supervisor = false -synthio = false -terminalio = false -tilepalettemapper = false -time = true -touchio = false -traceback = false -uheap = false -ulab = false -usb = false -usb_cdc = false -usb_hid = false -usb_host = false -usb_midi = false -usb_video = false -ustack = false -vectorio = false -warnings = false -watchdog = false -wifi = false -wiznet = false -zephyr_kernel = false -zephyr_serial = true -zlib = false diff --git a/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml deleted file mode 100644 index a1876eb36a842..0000000000000 --- a/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml +++ /dev/null @@ -1,133 +0,0 @@ -# This file is autogenerated when a board is built. Do not edit. Do commit it to git. Other scripts use its info. -name = "Nordic Semiconductor nRF7002 DK" - -[modules] -__future__ = false -_bleio = false -_eve = false -_pew = false -_pixelbuf = false -_pixelmap = false -_stage = false -_typing = false -adafruit_bus_device = false -adafruit_pixelbuf = false -aesio = false -alarm = false -analogbufio = false -analogio = false -atexit = false -audiobusio = false -audiocore = false -audiodelays = false -audiofilters = false -audiofreeverb = false -audioio = false -audiomixer = false -audiomp3 = false -audiopwmio = false -aurora_epaper = false -bitbangio = false -bitmapfilter = false -bitmaptools = false -bitops = false -board = false -busdisplay = false -busio = false -camera = false -canio = false -circuitpython_typing = false -codeop = false -countio = false -cyw43 = false -digitalio = true -displayio = false -dotclockframebuffer = false -dualbank = false -epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false -floppyio = false -fontio = false -fourwire = false -framebufferio = false -frequencyio = false -gamepad = false -gamepadshift = false -getpass = false -gifio = false -gnss = false -hashlib = false -i2cdisplaybus = false -i2cperipheral = false -i2ctarget = false -imagecapture = false -ipaddress = false -is31fl3741 = false -jpegio = false -keypad = false -keypad_demux = false -locale = false -math = false -max3421e = false -mdns = false -memorymap = false -memorymonitor = false -microcontroller = true -msgpack = false -multiterminal = false -neopixel_write = false -network = false -nvm = false -onewireio = false -os = true -paralleldisplay = false -paralleldisplaybus = false -picodvi = false -ps2io = false -pulseio = false -pwmio = false -qrio = false -rainbowio = false -random = true -rgbmatrix = false -rotaryio = false -rp2pio = false -rtc = false -samd = false -sdcardio = false -sdioio = false -sharpdisplay = false -socket = false -socketpool = true # Zephyr networking enabled -spitarget = false -ssl = true # Zephyr networking enabled -storage = true # Zephyr board has flash -struct = true -supervisor = false -synthio = false -terminalio = false -tilepalettemapper = false -time = true -touchio = false -traceback = false -uheap = false -ulab = false -usb = false -usb_cdc = true -usb_hid = false -usb_host = false -usb_midi = false -usb_video = false -ustack = false -vectorio = false -warnings = false -watchdog = false -wifi = true # Zephyr board has wifi -wiznet = false -zephyr_kernel = false -zephyr_serial = true -zlib = false diff --git a/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml b/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml deleted file mode 100644 index 251f0461a7622..0000000000000 --- a/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml +++ /dev/null @@ -1,133 +0,0 @@ -# This file is autogenerated when a board is built. Do not edit. Do commit it to git. Other scripts use its info. -name = "Renesas Electronics Corporation RA6M5 Evaluation Kit" - -[modules] -__future__ = false -_bleio = false -_eve = false -_pew = false -_pixelbuf = false -_pixelmap = false -_stage = false -_typing = false -adafruit_bus_device = false -adafruit_pixelbuf = false -aesio = false -alarm = false -analogbufio = false -analogio = false -atexit = false -audiobusio = false -audiocore = false -audiodelays = false -audiofilters = false -audiofreeverb = false -audioio = false -audiomixer = false -audiomp3 = false -audiopwmio = false -aurora_epaper = false -bitbangio = false -bitmapfilter = false -bitmaptools = false -bitops = false -board = false -busdisplay = false -busio = false -camera = false -canio = false -circuitpython_typing = false -codeop = false -countio = false -cyw43 = false -digitalio = true -displayio = false -dotclockframebuffer = false -dualbank = false -epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false -floppyio = false -fontio = false -fourwire = false -framebufferio = false -frequencyio = false -gamepad = false -gamepadshift = false -getpass = false -gifio = false -gnss = false -hashlib = false -i2cdisplaybus = false -i2cperipheral = false -i2ctarget = false -imagecapture = false -ipaddress = false -is31fl3741 = false -jpegio = false -keypad = false -keypad_demux = false -locale = false -math = false -max3421e = false -mdns = false -memorymap = false -memorymonitor = false -microcontroller = true -msgpack = false -multiterminal = false -neopixel_write = false -network = false -nvm = false -onewireio = false -os = true -paralleldisplay = false -paralleldisplaybus = false -picodvi = false -ps2io = false -pulseio = false -pwmio = false -qrio = false -rainbowio = false -random = true -rgbmatrix = false -rotaryio = false -rp2pio = false -rtc = false -samd = false -sdcardio = false -sdioio = false -sharpdisplay = false -socket = false -socketpool = false -spitarget = false -ssl = false -storage = true # Zephyr board has flash -struct = true -supervisor = false -synthio = false -terminalio = false -tilepalettemapper = false -time = true -touchio = false -traceback = false -uheap = false -ulab = false -usb = false -usb_cdc = false # No TinyUSB settings for r7fa6m5bh3cfc -usb_hid = false -usb_host = false -usb_midi = false -usb_video = false -ustack = false -vectorio = false -warnings = false -watchdog = false -wifi = false -wiznet = false -zephyr_kernel = false -zephyr_serial = true -zlib = false diff --git a/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml b/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml deleted file mode 100644 index e467d211bde86..0000000000000 --- a/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml +++ /dev/null @@ -1,133 +0,0 @@ -# This file is autogenerated when a board is built. Do not edit. Do commit it to git. Other scripts use its info. -name = "Renesas Electronics Corporation RA8D1 Evaluation Kit" - -[modules] -__future__ = false -_bleio = false -_eve = false -_pew = false -_pixelbuf = false -_pixelmap = false -_stage = false -_typing = false -adafruit_bus_device = false -adafruit_pixelbuf = false -aesio = false -alarm = false -analogbufio = false -analogio = false -atexit = false -audiobusio = false -audiocore = false -audiodelays = false -audiofilters = false -audiofreeverb = false -audioio = false -audiomixer = false -audiomp3 = false -audiopwmio = false -aurora_epaper = false -bitbangio = false -bitmapfilter = false -bitmaptools = false -bitops = false -board = false -busdisplay = false -busio = false -camera = false -canio = false -circuitpython_typing = false -codeop = false -countio = false -cyw43 = false -digitalio = true -displayio = false -dotclockframebuffer = false -dualbank = false -epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false -floppyio = false -fontio = false -fourwire = false -framebufferio = false -frequencyio = false -gamepad = false -gamepadshift = false -getpass = false -gifio = false -gnss = false -hashlib = false -i2cdisplaybus = false -i2cperipheral = false -i2ctarget = false -imagecapture = false -ipaddress = false -is31fl3741 = false -jpegio = false -keypad = false -keypad_demux = false -locale = false -math = false -max3421e = false -mdns = false -memorymap = false -memorymonitor = false -microcontroller = true -msgpack = false -multiterminal = false -neopixel_write = false -network = false -nvm = false -onewireio = false -os = true -paralleldisplay = false -paralleldisplaybus = false -picodvi = false -ps2io = false -pulseio = false -pwmio = false -qrio = false -rainbowio = false -random = true -rgbmatrix = false -rotaryio = false -rp2pio = false -rtc = false -samd = false -sdcardio = false -sdioio = false -sharpdisplay = false -socket = false -socketpool = false -spitarget = false -ssl = false -storage = true # Zephyr board has flash -struct = true -supervisor = false -synthio = false -terminalio = false -tilepalettemapper = false -time = true -touchio = false -traceback = false -uheap = false -ulab = false -usb = false -usb_cdc = false # No TinyUSB settings for r7fa8d1bhecbd -usb_hid = false -usb_host = false -usb_midi = false -usb_video = false -ustack = false -vectorio = false -warnings = false -watchdog = false -wifi = false -wiznet = false -zephyr_kernel = false -zephyr_serial = true -zlib = false diff --git a/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml b/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml deleted file mode 100644 index fe2c72787bcec..0000000000000 --- a/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml +++ /dev/null @@ -1,133 +0,0 @@ -# This file is autogenerated when a board is built. Do not edit. Do commit it to git. Other scripts use its info. -name = "STMicroelectronics Nucleo U575ZI Q" - -[modules] -__future__ = false -_bleio = false -_eve = false -_pew = false -_pixelbuf = false -_pixelmap = false -_stage = false -_typing = false -adafruit_bus_device = false -adafruit_pixelbuf = false -aesio = false -alarm = false -analogbufio = false -analogio = false -atexit = false -audiobusio = false -audiocore = false -audiodelays = false -audiofilters = false -audiofreeverb = false -audioio = false -audiomixer = false -audiomp3 = false -audiopwmio = false -aurora_epaper = false -bitbangio = false -bitmapfilter = false -bitmaptools = false -bitops = false -board = false -busdisplay = false -busio = false -camera = false -canio = false -circuitpython_typing = false -codeop = false -countio = false -cyw43 = false -digitalio = true -displayio = false -dotclockframebuffer = false -dualbank = false -epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false -floppyio = false -fontio = false -fourwire = false -framebufferio = false -frequencyio = false -gamepad = false -gamepadshift = false -getpass = false -gifio = false -gnss = false -hashlib = false -i2cdisplaybus = false -i2cperipheral = false -i2ctarget = false -imagecapture = false -ipaddress = false -is31fl3741 = false -jpegio = false -keypad = false -keypad_demux = false -locale = false -math = false -max3421e = false -mdns = false -memorymap = false -memorymonitor = false -microcontroller = true -msgpack = false -multiterminal = false -neopixel_write = false -network = false -nvm = false -onewireio = false -os = true -paralleldisplay = false -paralleldisplaybus = false -picodvi = false -ps2io = false -pulseio = false -pwmio = false -qrio = false -rainbowio = false -random = true -rgbmatrix = false -rotaryio = false -rp2pio = false -rtc = false -samd = false -sdcardio = false -sdioio = false -sharpdisplay = false -socket = false -socketpool = false -spitarget = false -ssl = false -storage = false -struct = true -supervisor = false -synthio = false -terminalio = false -tilepalettemapper = false -time = true -touchio = false -traceback = false -uheap = false -ulab = false -usb = false -usb_cdc = true -usb_hid = false -usb_host = false -usb_midi = false -usb_video = false -ustack = false -vectorio = false -warnings = false -watchdog = false -wifi = false -wiznet = false -zephyr_kernel = false -zephyr_serial = true -zlib = false diff --git a/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml b/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml deleted file mode 100644 index 0eb1b5a17c61d..0000000000000 --- a/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml +++ /dev/null @@ -1,133 +0,0 @@ -# This file is autogenerated when a board is built. Do not edit. Do commit it to git. Other scripts use its info. -name = "STMicroelectronics STM32H7B3I Discovery kit" - -[modules] -__future__ = false -_bleio = false -_eve = false -_pew = false -_pixelbuf = false -_pixelmap = false -_stage = false -_typing = false -adafruit_bus_device = false -adafruit_pixelbuf = false -aesio = false -alarm = false -analogbufio = false -analogio = false -atexit = false -audiobusio = false -audiocore = false -audiodelays = false -audiofilters = false -audiofreeverb = false -audioio = false -audiomixer = false -audiomp3 = false -audiopwmio = false -aurora_epaper = false -bitbangio = false -bitmapfilter = false -bitmaptools = false -bitops = false -board = false -busdisplay = false -busio = false -camera = false -canio = false -circuitpython_typing = false -codeop = false -countio = false -cyw43 = false -digitalio = true -displayio = false -dotclockframebuffer = false -dualbank = false -epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false -floppyio = false -fontio = false -fourwire = false -framebufferio = false -frequencyio = false -gamepad = false -gamepadshift = false -getpass = false -gifio = false -gnss = false -hashlib = false -i2cdisplaybus = false -i2cperipheral = false -i2ctarget = false -imagecapture = false -ipaddress = false -is31fl3741 = false -jpegio = false -keypad = false -keypad_demux = false -locale = false -math = false -max3421e = false -mdns = false -memorymap = false -memorymonitor = false -microcontroller = true -msgpack = false -multiterminal = false -neopixel_write = false -network = false -nvm = false -onewireio = false -os = true -paralleldisplay = false -paralleldisplaybus = false -picodvi = false -ps2io = false -pulseio = false -pwmio = false -qrio = false -rainbowio = false -random = true -rgbmatrix = false -rotaryio = false -rp2pio = false -rtc = false -samd = false -sdcardio = false -sdioio = false -sharpdisplay = false -socket = false -socketpool = false -spitarget = false -ssl = false -storage = true # Zephyr board has flash -struct = true -supervisor = false -synthio = false -terminalio = false -tilepalettemapper = false -time = true -touchio = false -traceback = false -uheap = false -ulab = false -usb = false -usb_cdc = false -usb_hid = false -usb_host = false -usb_midi = false -usb_video = false -ustack = false -vectorio = false -warnings = false -watchdog = false -wifi = false -wiznet = false -zephyr_kernel = false -zephyr_serial = true -zlib = false From fb34bc73eac1628b72a7b60f2adec07d48b97e65 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 19 Apr 2025 15:30:20 -0500 Subject: [PATCH 19/24] Revert "Removing autogen files" This reverts commit fa863cf695a5a46a92015dee66cd4c07273bd758. --- .../nordic/nrf5340dk/autogen_board_info.toml | 133 ++++++++++++++++++ .../nordic/nrf54l15dk/autogen_board_info.toml | 133 ++++++++++++++++++ .../nordic/nrf7002dk/autogen_board_info.toml | 133 ++++++++++++++++++ .../renesas/ek_ra6m5/autogen_board_info.toml | 133 ++++++++++++++++++ .../renesas/ek_ra8d1/autogen_board_info.toml | 133 ++++++++++++++++++ .../nucleo_u575zi_q/autogen_board_info.toml | 133 ++++++++++++++++++ .../st/stm32h7b3i_dk/autogen_board_info.toml | 133 ++++++++++++++++++ 7 files changed, 931 insertions(+) create mode 100644 ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml create mode 100644 ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml create mode 100644 ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml create mode 100644 ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml create mode 100644 ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml create mode 100644 ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml create mode 100644 ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml diff --git a/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml new file mode 100644 index 0000000000000..5a8b37790d3c9 --- /dev/null +++ b/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml @@ -0,0 +1,133 @@ +# This file is autogenerated when a board is built. Do not edit. Do commit it to git. Other scripts use its info. +name = "Nordic Semiconductor nRF5340 DK" + +[modules] +__future__ = false +_bleio = false +_eve = false +_pew = false +_pixelbuf = false +_pixelmap = false +_stage = false +_typing = false +adafruit_bus_device = false +adafruit_pixelbuf = false +aesio = false +alarm = false +analogbufio = false +analogio = false +atexit = false +audiobusio = false +audiocore = false +audiodelays = false +audiofilters = false +audiofreeverb = false +audioio = false +audiomixer = false +audiomp3 = false +audiopwmio = false +aurora_epaper = false +bitbangio = false +bitmapfilter = false +bitmaptools = false +bitops = false +board = false +busdisplay = false +busio = false +camera = false +canio = false +circuitpython_typing = false +codeop = false +countio = false +cyw43 = false +digitalio = true +displayio = false +dotclockframebuffer = false +dualbank = false +epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false +floppyio = false +fontio = false +fourwire = false +framebufferio = false +frequencyio = false +gamepad = false +gamepadshift = false +getpass = false +gifio = false +gnss = false +hashlib = false +i2cdisplaybus = false +i2cperipheral = false +i2ctarget = false +imagecapture = false +ipaddress = false +is31fl3741 = false +jpegio = false +keypad = false +keypad_demux = false +locale = false +math = false +max3421e = false +mdns = false +memorymap = false +memorymonitor = false +microcontroller = true +msgpack = false +multiterminal = false +neopixel_write = false +network = false +nvm = false +onewireio = false +os = true +paralleldisplay = false +paralleldisplaybus = false +picodvi = false +ps2io = false +pulseio = false +pwmio = false +qrio = false +rainbowio = false +random = true +rgbmatrix = false +rotaryio = false +rp2pio = false +rtc = false +samd = false +sdcardio = false +sdioio = false +sharpdisplay = false +socket = false +socketpool = false +spitarget = false +ssl = false +storage = true # Zephyr board has flash +struct = true +supervisor = false +synthio = false +terminalio = false +tilepalettemapper = false +time = true +touchio = false +traceback = false +uheap = false +ulab = false +usb = false +usb_cdc = true +usb_hid = false +usb_host = false +usb_midi = false +usb_video = false +ustack = false +vectorio = false +warnings = false +watchdog = false +wifi = false +wiznet = false +zephyr_kernel = false +zephyr_serial = true +zlib = false diff --git a/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml new file mode 100644 index 0000000000000..847c676389e78 --- /dev/null +++ b/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml @@ -0,0 +1,133 @@ +# This file is autogenerated when a board is built. Do not edit. Do commit it to git. Other scripts use its info. +name = "Nordic Semiconductor nRF54L15 DK" + +[modules] +__future__ = false +_bleio = false +_eve = false +_pew = false +_pixelbuf = false +_pixelmap = false +_stage = false +_typing = false +adafruit_bus_device = false +adafruit_pixelbuf = false +aesio = false +alarm = false +analogbufio = false +analogio = false +atexit = false +audiobusio = false +audiocore = false +audiodelays = false +audiofilters = false +audiofreeverb = false +audioio = false +audiomixer = false +audiomp3 = false +audiopwmio = false +aurora_epaper = false +bitbangio = false +bitmapfilter = false +bitmaptools = false +bitops = false +board = false +busdisplay = false +busio = false +camera = false +canio = false +circuitpython_typing = false +codeop = false +countio = false +cyw43 = false +digitalio = true +displayio = false +dotclockframebuffer = false +dualbank = false +epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false +floppyio = false +fontio = false +fourwire = false +framebufferio = false +frequencyio = false +gamepad = false +gamepadshift = false +getpass = false +gifio = false +gnss = false +hashlib = false +i2cdisplaybus = false +i2cperipheral = false +i2ctarget = false +imagecapture = false +ipaddress = false +is31fl3741 = false +jpegio = false +keypad = false +keypad_demux = false +locale = false +math = false +max3421e = false +mdns = false +memorymap = false +memorymonitor = false +microcontroller = true +msgpack = false +multiterminal = false +neopixel_write = false +network = false +nvm = false +onewireio = false +os = true +paralleldisplay = false +paralleldisplaybus = false +picodvi = false +ps2io = false +pulseio = false +pwmio = false +qrio = false +rainbowio = false +random = true +rgbmatrix = false +rotaryio = false +rp2pio = false +rtc = false +samd = false +sdcardio = false +sdioio = false +sharpdisplay = false +socket = false +socketpool = false +spitarget = false +ssl = false +storage = true # Zephyr board has flash +struct = true +supervisor = false +synthio = false +terminalio = false +tilepalettemapper = false +time = true +touchio = false +traceback = false +uheap = false +ulab = false +usb = false +usb_cdc = false +usb_hid = false +usb_host = false +usb_midi = false +usb_video = false +ustack = false +vectorio = false +warnings = false +watchdog = false +wifi = false +wiznet = false +zephyr_kernel = false +zephyr_serial = true +zlib = false diff --git a/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml new file mode 100644 index 0000000000000..a1876eb36a842 --- /dev/null +++ b/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml @@ -0,0 +1,133 @@ +# This file is autogenerated when a board is built. Do not edit. Do commit it to git. Other scripts use its info. +name = "Nordic Semiconductor nRF7002 DK" + +[modules] +__future__ = false +_bleio = false +_eve = false +_pew = false +_pixelbuf = false +_pixelmap = false +_stage = false +_typing = false +adafruit_bus_device = false +adafruit_pixelbuf = false +aesio = false +alarm = false +analogbufio = false +analogio = false +atexit = false +audiobusio = false +audiocore = false +audiodelays = false +audiofilters = false +audiofreeverb = false +audioio = false +audiomixer = false +audiomp3 = false +audiopwmio = false +aurora_epaper = false +bitbangio = false +bitmapfilter = false +bitmaptools = false +bitops = false +board = false +busdisplay = false +busio = false +camera = false +canio = false +circuitpython_typing = false +codeop = false +countio = false +cyw43 = false +digitalio = true +displayio = false +dotclockframebuffer = false +dualbank = false +epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false +floppyio = false +fontio = false +fourwire = false +framebufferio = false +frequencyio = false +gamepad = false +gamepadshift = false +getpass = false +gifio = false +gnss = false +hashlib = false +i2cdisplaybus = false +i2cperipheral = false +i2ctarget = false +imagecapture = false +ipaddress = false +is31fl3741 = false +jpegio = false +keypad = false +keypad_demux = false +locale = false +math = false +max3421e = false +mdns = false +memorymap = false +memorymonitor = false +microcontroller = true +msgpack = false +multiterminal = false +neopixel_write = false +network = false +nvm = false +onewireio = false +os = true +paralleldisplay = false +paralleldisplaybus = false +picodvi = false +ps2io = false +pulseio = false +pwmio = false +qrio = false +rainbowio = false +random = true +rgbmatrix = false +rotaryio = false +rp2pio = false +rtc = false +samd = false +sdcardio = false +sdioio = false +sharpdisplay = false +socket = false +socketpool = true # Zephyr networking enabled +spitarget = false +ssl = true # Zephyr networking enabled +storage = true # Zephyr board has flash +struct = true +supervisor = false +synthio = false +terminalio = false +tilepalettemapper = false +time = true +touchio = false +traceback = false +uheap = false +ulab = false +usb = false +usb_cdc = true +usb_hid = false +usb_host = false +usb_midi = false +usb_video = false +ustack = false +vectorio = false +warnings = false +watchdog = false +wifi = true # Zephyr board has wifi +wiznet = false +zephyr_kernel = false +zephyr_serial = true +zlib = false diff --git a/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml b/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml new file mode 100644 index 0000000000000..251f0461a7622 --- /dev/null +++ b/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml @@ -0,0 +1,133 @@ +# This file is autogenerated when a board is built. Do not edit. Do commit it to git. Other scripts use its info. +name = "Renesas Electronics Corporation RA6M5 Evaluation Kit" + +[modules] +__future__ = false +_bleio = false +_eve = false +_pew = false +_pixelbuf = false +_pixelmap = false +_stage = false +_typing = false +adafruit_bus_device = false +adafruit_pixelbuf = false +aesio = false +alarm = false +analogbufio = false +analogio = false +atexit = false +audiobusio = false +audiocore = false +audiodelays = false +audiofilters = false +audiofreeverb = false +audioio = false +audiomixer = false +audiomp3 = false +audiopwmio = false +aurora_epaper = false +bitbangio = false +bitmapfilter = false +bitmaptools = false +bitops = false +board = false +busdisplay = false +busio = false +camera = false +canio = false +circuitpython_typing = false +codeop = false +countio = false +cyw43 = false +digitalio = true +displayio = false +dotclockframebuffer = false +dualbank = false +epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false +floppyio = false +fontio = false +fourwire = false +framebufferio = false +frequencyio = false +gamepad = false +gamepadshift = false +getpass = false +gifio = false +gnss = false +hashlib = false +i2cdisplaybus = false +i2cperipheral = false +i2ctarget = false +imagecapture = false +ipaddress = false +is31fl3741 = false +jpegio = false +keypad = false +keypad_demux = false +locale = false +math = false +max3421e = false +mdns = false +memorymap = false +memorymonitor = false +microcontroller = true +msgpack = false +multiterminal = false +neopixel_write = false +network = false +nvm = false +onewireio = false +os = true +paralleldisplay = false +paralleldisplaybus = false +picodvi = false +ps2io = false +pulseio = false +pwmio = false +qrio = false +rainbowio = false +random = true +rgbmatrix = false +rotaryio = false +rp2pio = false +rtc = false +samd = false +sdcardio = false +sdioio = false +sharpdisplay = false +socket = false +socketpool = false +spitarget = false +ssl = false +storage = true # Zephyr board has flash +struct = true +supervisor = false +synthio = false +terminalio = false +tilepalettemapper = false +time = true +touchio = false +traceback = false +uheap = false +ulab = false +usb = false +usb_cdc = false # No TinyUSB settings for r7fa6m5bh3cfc +usb_hid = false +usb_host = false +usb_midi = false +usb_video = false +ustack = false +vectorio = false +warnings = false +watchdog = false +wifi = false +wiznet = false +zephyr_kernel = false +zephyr_serial = true +zlib = false diff --git a/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml b/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml new file mode 100644 index 0000000000000..e467d211bde86 --- /dev/null +++ b/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml @@ -0,0 +1,133 @@ +# This file is autogenerated when a board is built. Do not edit. Do commit it to git. Other scripts use its info. +name = "Renesas Electronics Corporation RA8D1 Evaluation Kit" + +[modules] +__future__ = false +_bleio = false +_eve = false +_pew = false +_pixelbuf = false +_pixelmap = false +_stage = false +_typing = false +adafruit_bus_device = false +adafruit_pixelbuf = false +aesio = false +alarm = false +analogbufio = false +analogio = false +atexit = false +audiobusio = false +audiocore = false +audiodelays = false +audiofilters = false +audiofreeverb = false +audioio = false +audiomixer = false +audiomp3 = false +audiopwmio = false +aurora_epaper = false +bitbangio = false +bitmapfilter = false +bitmaptools = false +bitops = false +board = false +busdisplay = false +busio = false +camera = false +canio = false +circuitpython_typing = false +codeop = false +countio = false +cyw43 = false +digitalio = true +displayio = false +dotclockframebuffer = false +dualbank = false +epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false +floppyio = false +fontio = false +fourwire = false +framebufferio = false +frequencyio = false +gamepad = false +gamepadshift = false +getpass = false +gifio = false +gnss = false +hashlib = false +i2cdisplaybus = false +i2cperipheral = false +i2ctarget = false +imagecapture = false +ipaddress = false +is31fl3741 = false +jpegio = false +keypad = false +keypad_demux = false +locale = false +math = false +max3421e = false +mdns = false +memorymap = false +memorymonitor = false +microcontroller = true +msgpack = false +multiterminal = false +neopixel_write = false +network = false +nvm = false +onewireio = false +os = true +paralleldisplay = false +paralleldisplaybus = false +picodvi = false +ps2io = false +pulseio = false +pwmio = false +qrio = false +rainbowio = false +random = true +rgbmatrix = false +rotaryio = false +rp2pio = false +rtc = false +samd = false +sdcardio = false +sdioio = false +sharpdisplay = false +socket = false +socketpool = false +spitarget = false +ssl = false +storage = true # Zephyr board has flash +struct = true +supervisor = false +synthio = false +terminalio = false +tilepalettemapper = false +time = true +touchio = false +traceback = false +uheap = false +ulab = false +usb = false +usb_cdc = false # No TinyUSB settings for r7fa8d1bhecbd +usb_hid = false +usb_host = false +usb_midi = false +usb_video = false +ustack = false +vectorio = false +warnings = false +watchdog = false +wifi = false +wiznet = false +zephyr_kernel = false +zephyr_serial = true +zlib = false diff --git a/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml b/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml new file mode 100644 index 0000000000000..fe2c72787bcec --- /dev/null +++ b/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml @@ -0,0 +1,133 @@ +# This file is autogenerated when a board is built. Do not edit. Do commit it to git. Other scripts use its info. +name = "STMicroelectronics Nucleo U575ZI Q" + +[modules] +__future__ = false +_bleio = false +_eve = false +_pew = false +_pixelbuf = false +_pixelmap = false +_stage = false +_typing = false +adafruit_bus_device = false +adafruit_pixelbuf = false +aesio = false +alarm = false +analogbufio = false +analogio = false +atexit = false +audiobusio = false +audiocore = false +audiodelays = false +audiofilters = false +audiofreeverb = false +audioio = false +audiomixer = false +audiomp3 = false +audiopwmio = false +aurora_epaper = false +bitbangio = false +bitmapfilter = false +bitmaptools = false +bitops = false +board = false +busdisplay = false +busio = false +camera = false +canio = false +circuitpython_typing = false +codeop = false +countio = false +cyw43 = false +digitalio = true +displayio = false +dotclockframebuffer = false +dualbank = false +epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false +floppyio = false +fontio = false +fourwire = false +framebufferio = false +frequencyio = false +gamepad = false +gamepadshift = false +getpass = false +gifio = false +gnss = false +hashlib = false +i2cdisplaybus = false +i2cperipheral = false +i2ctarget = false +imagecapture = false +ipaddress = false +is31fl3741 = false +jpegio = false +keypad = false +keypad_demux = false +locale = false +math = false +max3421e = false +mdns = false +memorymap = false +memorymonitor = false +microcontroller = true +msgpack = false +multiterminal = false +neopixel_write = false +network = false +nvm = false +onewireio = false +os = true +paralleldisplay = false +paralleldisplaybus = false +picodvi = false +ps2io = false +pulseio = false +pwmio = false +qrio = false +rainbowio = false +random = true +rgbmatrix = false +rotaryio = false +rp2pio = false +rtc = false +samd = false +sdcardio = false +sdioio = false +sharpdisplay = false +socket = false +socketpool = false +spitarget = false +ssl = false +storage = false +struct = true +supervisor = false +synthio = false +terminalio = false +tilepalettemapper = false +time = true +touchio = false +traceback = false +uheap = false +ulab = false +usb = false +usb_cdc = true +usb_hid = false +usb_host = false +usb_midi = false +usb_video = false +ustack = false +vectorio = false +warnings = false +watchdog = false +wifi = false +wiznet = false +zephyr_kernel = false +zephyr_serial = true +zlib = false diff --git a/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml b/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml new file mode 100644 index 0000000000000..0eb1b5a17c61d --- /dev/null +++ b/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml @@ -0,0 +1,133 @@ +# This file is autogenerated when a board is built. Do not edit. Do commit it to git. Other scripts use its info. +name = "STMicroelectronics STM32H7B3I Discovery kit" + +[modules] +__future__ = false +_bleio = false +_eve = false +_pew = false +_pixelbuf = false +_pixelmap = false +_stage = false +_typing = false +adafruit_bus_device = false +adafruit_pixelbuf = false +aesio = false +alarm = false +analogbufio = false +analogio = false +atexit = false +audiobusio = false +audiocore = false +audiodelays = false +audiofilters = false +audiofreeverb = false +audioio = false +audiomixer = false +audiomp3 = false +audiopwmio = false +aurora_epaper = false +bitbangio = false +bitmapfilter = false +bitmaptools = false +bitops = false +board = false +busdisplay = false +busio = false +camera = false +canio = false +circuitpython_typing = false +codeop = false +countio = false +cyw43 = false +digitalio = true +displayio = false +dotclockframebuffer = false +dualbank = false +epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false +floppyio = false +fontio = false +fourwire = false +framebufferio = false +frequencyio = false +gamepad = false +gamepadshift = false +getpass = false +gifio = false +gnss = false +hashlib = false +i2cdisplaybus = false +i2cperipheral = false +i2ctarget = false +imagecapture = false +ipaddress = false +is31fl3741 = false +jpegio = false +keypad = false +keypad_demux = false +locale = false +math = false +max3421e = false +mdns = false +memorymap = false +memorymonitor = false +microcontroller = true +msgpack = false +multiterminal = false +neopixel_write = false +network = false +nvm = false +onewireio = false +os = true +paralleldisplay = false +paralleldisplaybus = false +picodvi = false +ps2io = false +pulseio = false +pwmio = false +qrio = false +rainbowio = false +random = true +rgbmatrix = false +rotaryio = false +rp2pio = false +rtc = false +samd = false +sdcardio = false +sdioio = false +sharpdisplay = false +socket = false +socketpool = false +spitarget = false +ssl = false +storage = true # Zephyr board has flash +struct = true +supervisor = false +synthio = false +terminalio = false +tilepalettemapper = false +time = true +touchio = false +traceback = false +uheap = false +ulab = false +usb = false +usb_cdc = false +usb_hid = false +usb_host = false +usb_midi = false +usb_video = false +ustack = false +vectorio = false +warnings = false +watchdog = false +wifi = false +wiznet = false +zephyr_kernel = false +zephyr_serial = true +zlib = false From eb53338e1bc3b2bf9f6a33525880f6a7d0097d22 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 19 Apr 2025 15:33:39 -0500 Subject: [PATCH 20/24] Revert "Fixes for zephyr build" This reverts commit f011df26faa3a4a083e116637c323d50d48b6d50. --- .../nordic/nrf5340dk/autogen_board_info.toml | 22 ------------------- .../nordic/nrf54l15dk/autogen_board_info.toml | 22 ------------------- .../nordic/nrf7002dk/autogen_board_info.toml | 22 ------------------- .../renesas/ek_ra6m5/autogen_board_info.toml | 22 ------------------- .../renesas/ek_ra8d1/autogen_board_info.toml | 22 ------------------- .../nucleo_u575zi_q/autogen_board_info.toml | 22 ------------------- .../st/stm32h7b3i_dk/autogen_board_info.toml | 22 ------------------- shared-bindings/audiodelays/__init__.c | 1 + shared-module/audiofreeverb/Freeverb.c | 8 +++---- 9 files changed, 5 insertions(+), 158 deletions(-) diff --git a/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml index 5a8b37790d3c9..ba0291f64300a 100644 --- a/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml @@ -6,10 +6,8 @@ __future__ = false _bleio = false _eve = false _pew = false -_pixelbuf = false _pixelmap = false _stage = false -_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -21,7 +19,6 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false -audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -36,33 +33,23 @@ busdisplay = false busio = false camera = false canio = false -circuitpython_typing = false codeop = false countio = false -cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false -gamepad = false -gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false -i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -78,15 +65,11 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false -multiterminal = false neopixel_write = false -network = false nvm = false onewireio = false os = true -paralleldisplay = false paralleldisplaybus = false -picodvi = false ps2io = false pulseio = false pwmio = false @@ -95,13 +78,10 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false -rp2pio = false rtc = false -samd = false sdcardio = false sdioio = false sharpdisplay = false -socket = false socketpool = false spitarget = false ssl = false @@ -115,7 +95,6 @@ time = true touchio = false traceback = false uheap = false -ulab = false usb = false usb_cdc = true usb_hid = false @@ -127,7 +106,6 @@ vectorio = false warnings = false watchdog = false wifi = false -wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml index 847c676389e78..88178af3b28c2 100644 --- a/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml @@ -6,10 +6,8 @@ __future__ = false _bleio = false _eve = false _pew = false -_pixelbuf = false _pixelmap = false _stage = false -_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -21,7 +19,6 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false -audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -36,33 +33,23 @@ busdisplay = false busio = false camera = false canio = false -circuitpython_typing = false codeop = false countio = false -cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false -gamepad = false -gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false -i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -78,15 +65,11 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false -multiterminal = false neopixel_write = false -network = false nvm = false onewireio = false os = true -paralleldisplay = false paralleldisplaybus = false -picodvi = false ps2io = false pulseio = false pwmio = false @@ -95,13 +78,10 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false -rp2pio = false rtc = false -samd = false sdcardio = false sdioio = false sharpdisplay = false -socket = false socketpool = false spitarget = false ssl = false @@ -115,7 +95,6 @@ time = true touchio = false traceback = false uheap = false -ulab = false usb = false usb_cdc = false usb_hid = false @@ -127,7 +106,6 @@ vectorio = false warnings = false watchdog = false wifi = false -wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml index a1876eb36a842..85b5a9c7e0fad 100644 --- a/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml @@ -6,10 +6,8 @@ __future__ = false _bleio = false _eve = false _pew = false -_pixelbuf = false _pixelmap = false _stage = false -_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -21,7 +19,6 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false -audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -36,33 +33,23 @@ busdisplay = false busio = false camera = false canio = false -circuitpython_typing = false codeop = false countio = false -cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false -gamepad = false -gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false -i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -78,15 +65,11 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false -multiterminal = false neopixel_write = false -network = false nvm = false onewireio = false os = true -paralleldisplay = false paralleldisplaybus = false -picodvi = false ps2io = false pulseio = false pwmio = false @@ -95,13 +78,10 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false -rp2pio = false rtc = false -samd = false sdcardio = false sdioio = false sharpdisplay = false -socket = false socketpool = true # Zephyr networking enabled spitarget = false ssl = true # Zephyr networking enabled @@ -115,7 +95,6 @@ time = true touchio = false traceback = false uheap = false -ulab = false usb = false usb_cdc = true usb_hid = false @@ -127,7 +106,6 @@ vectorio = false warnings = false watchdog = false wifi = true # Zephyr board has wifi -wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml b/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml index 251f0461a7622..674a19ab107c9 100644 --- a/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml @@ -6,10 +6,8 @@ __future__ = false _bleio = false _eve = false _pew = false -_pixelbuf = false _pixelmap = false _stage = false -_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -21,7 +19,6 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false -audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -36,33 +33,23 @@ busdisplay = false busio = false camera = false canio = false -circuitpython_typing = false codeop = false countio = false -cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false -gamepad = false -gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false -i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -78,15 +65,11 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false -multiterminal = false neopixel_write = false -network = false nvm = false onewireio = false os = true -paralleldisplay = false paralleldisplaybus = false -picodvi = false ps2io = false pulseio = false pwmio = false @@ -95,13 +78,10 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false -rp2pio = false rtc = false -samd = false sdcardio = false sdioio = false sharpdisplay = false -socket = false socketpool = false spitarget = false ssl = false @@ -115,7 +95,6 @@ time = true touchio = false traceback = false uheap = false -ulab = false usb = false usb_cdc = false # No TinyUSB settings for r7fa6m5bh3cfc usb_hid = false @@ -127,7 +106,6 @@ vectorio = false warnings = false watchdog = false wifi = false -wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml b/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml index e467d211bde86..4f920c59f11d9 100644 --- a/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml @@ -6,10 +6,8 @@ __future__ = false _bleio = false _eve = false _pew = false -_pixelbuf = false _pixelmap = false _stage = false -_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -21,7 +19,6 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false -audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -36,33 +33,23 @@ busdisplay = false busio = false camera = false canio = false -circuitpython_typing = false codeop = false countio = false -cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false -gamepad = false -gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false -i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -78,15 +65,11 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false -multiterminal = false neopixel_write = false -network = false nvm = false onewireio = false os = true -paralleldisplay = false paralleldisplaybus = false -picodvi = false ps2io = false pulseio = false pwmio = false @@ -95,13 +78,10 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false -rp2pio = false rtc = false -samd = false sdcardio = false sdioio = false sharpdisplay = false -socket = false socketpool = false spitarget = false ssl = false @@ -115,7 +95,6 @@ time = true touchio = false traceback = false uheap = false -ulab = false usb = false usb_cdc = false # No TinyUSB settings for r7fa8d1bhecbd usb_hid = false @@ -127,7 +106,6 @@ vectorio = false warnings = false watchdog = false wifi = false -wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml b/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml index fe2c72787bcec..000155eafa744 100644 --- a/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml @@ -6,10 +6,8 @@ __future__ = false _bleio = false _eve = false _pew = false -_pixelbuf = false _pixelmap = false _stage = false -_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -21,7 +19,6 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false -audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -36,33 +33,23 @@ busdisplay = false busio = false camera = false canio = false -circuitpython_typing = false codeop = false countio = false -cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false -gamepad = false -gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false -i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -78,15 +65,11 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false -multiterminal = false neopixel_write = false -network = false nvm = false onewireio = false os = true -paralleldisplay = false paralleldisplaybus = false -picodvi = false ps2io = false pulseio = false pwmio = false @@ -95,13 +78,10 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false -rp2pio = false rtc = false -samd = false sdcardio = false sdioio = false sharpdisplay = false -socket = false socketpool = false spitarget = false ssl = false @@ -115,7 +95,6 @@ time = true touchio = false traceback = false uheap = false -ulab = false usb = false usb_cdc = true usb_hid = false @@ -127,7 +106,6 @@ vectorio = false warnings = false watchdog = false wifi = false -wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml b/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml index 0eb1b5a17c61d..ac0aff61a59c3 100644 --- a/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml @@ -6,10 +6,8 @@ __future__ = false _bleio = false _eve = false _pew = false -_pixelbuf = false _pixelmap = false _stage = false -_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -21,7 +19,6 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false -audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -36,33 +33,23 @@ busdisplay = false busio = false camera = false canio = false -circuitpython_typing = false codeop = false countio = false -cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false -gamepad = false -gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false -i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -78,15 +65,11 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false -multiterminal = false neopixel_write = false -network = false nvm = false onewireio = false os = true -paralleldisplay = false paralleldisplaybus = false -picodvi = false ps2io = false pulseio = false pwmio = false @@ -95,13 +78,10 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false -rp2pio = false rtc = false -samd = false sdcardio = false sdioio = false sharpdisplay = false -socket = false socketpool = false spitarget = false ssl = false @@ -115,7 +95,6 @@ time = true touchio = false traceback = false uheap = false -ulab = false usb = false usb_cdc = false usb_hid = false @@ -127,7 +106,6 @@ vectorio = false warnings = false watchdog = false wifi = false -wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false diff --git a/shared-bindings/audiodelays/__init__.c b/shared-bindings/audiodelays/__init__.c index 58cb9dc70a879..c0068a388e09c 100644 --- a/shared-bindings/audiodelays/__init__.c +++ b/shared-bindings/audiodelays/__init__.c @@ -13,6 +13,7 @@ #include "shared-bindings/audiodelays/Echo.h" #include "shared-bindings/audiodelays/PitchShift.h" + //| """Support for audio delay effects //| //| The `audiodelays` module contains classes to provide access to audio delay effects. diff --git a/shared-module/audiofreeverb/Freeverb.c b/shared-module/audiofreeverb/Freeverb.c index d5c4671595e1c..ea2d3dfbc9efe 100644 --- a/shared-module/audiofreeverb/Freeverb.c +++ b/shared-module/audiofreeverb/Freeverb.c @@ -33,14 +33,14 @@ void common_hal_audiofreeverb_freeverb_construct(audiofreeverb_freeverb_obj_t *s // Samples are set sequentially. For stereo audio they are passed L/R/L/R/... self->buffer_len = buffer_size; // in bytes - self->buffer[0] = m_malloc_maybe(self->buffer_len); + self->buffer[0] = m_malloc(self->buffer_len); if (self->buffer[0] == NULL) { common_hal_audiofreeverb_freeverb_deinit(self); m_malloc_fail(self->buffer_len); } memset(self->buffer[0], 0, self->buffer_len); - self->buffer[1] = m_malloc_maybe(self->buffer_len); + self->buffer[1] = m_malloc(self->buffer_len); if (self->buffer[1] == NULL) { common_hal_audiofreeverb_freeverb_deinit(self); m_malloc_fail(self->buffer_len); @@ -86,7 +86,7 @@ void common_hal_audiofreeverb_freeverb_construct(audiofreeverb_freeverb_obj_t *s self->combbuffersizes[6] = self->combbuffersizes[14] = 1557; self->combbuffersizes[7] = self->combbuffersizes[15] = 1617; for (uint32_t i = 0; i < 8 * channel_count; i++) { - self->combbuffers[i] = m_malloc_maybe(self->combbuffersizes[i] * sizeof(uint16_t)); + self->combbuffers[i] = m_malloc(self->combbuffersizes[i] * sizeof(uint16_t)); if (self->combbuffers[i] == NULL) { common_hal_audiofreeverb_freeverb_deinit(self); m_malloc_fail(self->combbuffersizes[i]); @@ -104,7 +104,7 @@ void common_hal_audiofreeverb_freeverb_construct(audiofreeverb_freeverb_obj_t *s self->allpassbuffersizes[2] = self->allpassbuffersizes[6] = 341; self->allpassbuffersizes[3] = self->allpassbuffersizes[7] = 225; for (uint32_t i = 0; i < 4 * channel_count; i++) { - self->allpassbuffers[i] = m_malloc_maybe(self->allpassbuffersizes[i] * sizeof(uint16_t)); + self->allpassbuffers[i] = m_malloc(self->allpassbuffersizes[i] * sizeof(uint16_t)); if (self->allpassbuffers[i] == NULL) { common_hal_audiofreeverb_freeverb_deinit(self); m_malloc_fail(self->allpassbuffersizes[i]); From f6357d5ddb6d1f7759fe6978697aafbb382118a6 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sat, 19 Apr 2025 15:35:42 -0500 Subject: [PATCH 21/24] Change to how malloc is called --- shared-bindings/audiodelays/__init__.c | 1 - shared-module/audiofreeverb/Freeverb.c | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/shared-bindings/audiodelays/__init__.c b/shared-bindings/audiodelays/__init__.c index c0068a388e09c..58cb9dc70a879 100644 --- a/shared-bindings/audiodelays/__init__.c +++ b/shared-bindings/audiodelays/__init__.c @@ -13,7 +13,6 @@ #include "shared-bindings/audiodelays/Echo.h" #include "shared-bindings/audiodelays/PitchShift.h" - //| """Support for audio delay effects //| //| The `audiodelays` module contains classes to provide access to audio delay effects. diff --git a/shared-module/audiofreeverb/Freeverb.c b/shared-module/audiofreeverb/Freeverb.c index ea2d3dfbc9efe..d5c4671595e1c 100644 --- a/shared-module/audiofreeverb/Freeverb.c +++ b/shared-module/audiofreeverb/Freeverb.c @@ -33,14 +33,14 @@ void common_hal_audiofreeverb_freeverb_construct(audiofreeverb_freeverb_obj_t *s // Samples are set sequentially. For stereo audio they are passed L/R/L/R/... self->buffer_len = buffer_size; // in bytes - self->buffer[0] = m_malloc(self->buffer_len); + self->buffer[0] = m_malloc_maybe(self->buffer_len); if (self->buffer[0] == NULL) { common_hal_audiofreeverb_freeverb_deinit(self); m_malloc_fail(self->buffer_len); } memset(self->buffer[0], 0, self->buffer_len); - self->buffer[1] = m_malloc(self->buffer_len); + self->buffer[1] = m_malloc_maybe(self->buffer_len); if (self->buffer[1] == NULL) { common_hal_audiofreeverb_freeverb_deinit(self); m_malloc_fail(self->buffer_len); @@ -86,7 +86,7 @@ void common_hal_audiofreeverb_freeverb_construct(audiofreeverb_freeverb_obj_t *s self->combbuffersizes[6] = self->combbuffersizes[14] = 1557; self->combbuffersizes[7] = self->combbuffersizes[15] = 1617; for (uint32_t i = 0; i < 8 * channel_count; i++) { - self->combbuffers[i] = m_malloc(self->combbuffersizes[i] * sizeof(uint16_t)); + self->combbuffers[i] = m_malloc_maybe(self->combbuffersizes[i] * sizeof(uint16_t)); if (self->combbuffers[i] == NULL) { common_hal_audiofreeverb_freeverb_deinit(self); m_malloc_fail(self->combbuffersizes[i]); @@ -104,7 +104,7 @@ void common_hal_audiofreeverb_freeverb_construct(audiofreeverb_freeverb_obj_t *s self->allpassbuffersizes[2] = self->allpassbuffersizes[6] = 341; self->allpassbuffersizes[3] = self->allpassbuffersizes[7] = 225; for (uint32_t i = 0; i < 4 * channel_count; i++) { - self->allpassbuffers[i] = m_malloc(self->allpassbuffersizes[i] * sizeof(uint16_t)); + self->allpassbuffers[i] = m_malloc_maybe(self->allpassbuffersizes[i] * sizeof(uint16_t)); if (self->allpassbuffers[i] == NULL) { common_hal_audiofreeverb_freeverb_deinit(self); m_malloc_fail(self->allpassbuffersizes[i]); From a8f29b483aa72fa2110b0093d1ec1b0d2606134d Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sun, 20 Apr 2025 09:49:39 -0500 Subject: [PATCH 22/24] Updated zephyr autogen files --- .../nordic/nrf5340dk/autogen_board_info.toml | 22 +++++++++++++++++++ .../nordic/nrf54l15dk/autogen_board_info.toml | 22 +++++++++++++++++++ .../nordic/nrf7002dk/autogen_board_info.toml | 22 +++++++++++++++++++ .../renesas/ek_ra6m5/autogen_board_info.toml | 22 +++++++++++++++++++ .../renesas/ek_ra8d1/autogen_board_info.toml | 22 +++++++++++++++++++ .../nucleo_u575zi_q/autogen_board_info.toml | 22 +++++++++++++++++++ .../st/stm32h7b3i_dk/autogen_board_info.toml | 22 +++++++++++++++++++ 7 files changed, 154 insertions(+) diff --git a/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml index 624e7e69a3fd1..b0f5b30f6b1a7 100644 --- a/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml @@ -6,8 +6,10 @@ __future__ = false _bleio = false _eve = false _pew = false +_pixelbuf = false _pixelmap = false _stage = false +_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -19,6 +21,7 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false +audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -33,23 +36,33 @@ busdisplay = false busio = false camera = false canio = false +circuitpython_typing = false codeop = false countio = false +cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false +gamepad = false +gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false +i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -66,11 +79,15 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false +multiterminal = false neopixel_write = false +network = false nvm = false onewireio = false os = true +paralleldisplay = false paralleldisplaybus = false +picodvi = false ps2io = false pulseio = false pwmio = false @@ -79,10 +96,13 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false +rp2pio = false rtc = false +samd = false sdcardio = false sdioio = false sharpdisplay = false +socket = false socketpool = false spitarget = false ssl = false @@ -96,6 +116,7 @@ time = true touchio = false traceback = false uheap = false +ulab = false usb = false usb_cdc = true usb_hid = false @@ -107,6 +128,7 @@ vectorio = false warnings = false watchdog = false wifi = false +wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml index 07ab1f7f4dfc6..3be836c4ad533 100644 --- a/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml @@ -6,8 +6,10 @@ __future__ = false _bleio = false _eve = false _pew = false +_pixelbuf = false _pixelmap = false _stage = false +_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -19,6 +21,7 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false +audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -33,23 +36,33 @@ busdisplay = false busio = false camera = false canio = false +circuitpython_typing = false codeop = false countio = false +cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false +gamepad = false +gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false +i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -66,11 +79,15 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false +multiterminal = false neopixel_write = false +network = false nvm = false onewireio = false os = true +paralleldisplay = false paralleldisplaybus = false +picodvi = false ps2io = false pulseio = false pwmio = false @@ -79,10 +96,13 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false +rp2pio = false rtc = false +samd = false sdcardio = false sdioio = false sharpdisplay = false +socket = false socketpool = false spitarget = false ssl = false @@ -96,6 +116,7 @@ time = true touchio = false traceback = false uheap = false +ulab = false usb = false usb_cdc = false usb_hid = false @@ -107,6 +128,7 @@ vectorio = false warnings = false watchdog = false wifi = false +wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml index b10bbe69a0a10..040d40869a8e2 100644 --- a/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml @@ -6,8 +6,10 @@ __future__ = false _bleio = false _eve = false _pew = false +_pixelbuf = false _pixelmap = false _stage = false +_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -19,6 +21,7 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false +audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -33,23 +36,33 @@ busdisplay = false busio = false camera = false canio = false +circuitpython_typing = false codeop = false countio = false +cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false +gamepad = false +gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false +i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -66,11 +79,15 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false +multiterminal = false neopixel_write = false +network = false nvm = false onewireio = false os = true +paralleldisplay = false paralleldisplaybus = false +picodvi = false ps2io = false pulseio = false pwmio = false @@ -79,10 +96,13 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false +rp2pio = false rtc = false +samd = false sdcardio = false sdioio = false sharpdisplay = false +socket = false socketpool = true # Zephyr networking enabled spitarget = false ssl = true # Zephyr networking enabled @@ -96,6 +116,7 @@ time = true touchio = false traceback = false uheap = false +ulab = false usb = false usb_cdc = true usb_hid = false @@ -107,6 +128,7 @@ vectorio = false warnings = false watchdog = false wifi = true # Zephyr board has wifi +wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml b/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml index fcfeec097d124..716be21226825 100644 --- a/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml @@ -6,8 +6,10 @@ __future__ = false _bleio = false _eve = false _pew = false +_pixelbuf = false _pixelmap = false _stage = false +_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -19,6 +21,7 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false +audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -33,23 +36,33 @@ busdisplay = false busio = false camera = false canio = false +circuitpython_typing = false codeop = false countio = false +cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false +gamepad = false +gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false +i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -66,11 +79,15 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false +multiterminal = false neopixel_write = false +network = false nvm = false onewireio = false os = true +paralleldisplay = false paralleldisplaybus = false +picodvi = false ps2io = false pulseio = false pwmio = false @@ -79,10 +96,13 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false +rp2pio = false rtc = false +samd = false sdcardio = false sdioio = false sharpdisplay = false +socket = false socketpool = false spitarget = false ssl = false @@ -96,6 +116,7 @@ time = true touchio = false traceback = false uheap = false +ulab = false usb = false usb_cdc = false # No TinyUSB settings for r7fa6m5bh3cfc usb_hid = false @@ -107,6 +128,7 @@ vectorio = false warnings = false watchdog = false wifi = false +wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml b/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml index 69481e904fea4..ceb9e15dcc0d4 100644 --- a/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml @@ -6,8 +6,10 @@ __future__ = false _bleio = false _eve = false _pew = false +_pixelbuf = false _pixelmap = false _stage = false +_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -19,6 +21,7 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false +audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -33,23 +36,33 @@ busdisplay = false busio = false camera = false canio = false +circuitpython_typing = false codeop = false countio = false +cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false +gamepad = false +gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false +i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -66,11 +79,15 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false +multiterminal = false neopixel_write = false +network = false nvm = false onewireio = false os = true +paralleldisplay = false paralleldisplaybus = false +picodvi = false ps2io = false pulseio = false pwmio = false @@ -79,10 +96,13 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false +rp2pio = false rtc = false +samd = false sdcardio = false sdioio = false sharpdisplay = false +socket = false socketpool = false spitarget = false ssl = false @@ -96,6 +116,7 @@ time = true touchio = false traceback = false uheap = false +ulab = false usb = false usb_cdc = false # No TinyUSB settings for r7fa8d1bhecbd usb_hid = false @@ -107,6 +128,7 @@ vectorio = false warnings = false watchdog = false wifi = false +wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml b/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml index e7e179e4c2cc9..caa357a2319d9 100644 --- a/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml @@ -6,8 +6,10 @@ __future__ = false _bleio = false _eve = false _pew = false +_pixelbuf = false _pixelmap = false _stage = false +_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -19,6 +21,7 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false +audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -33,23 +36,33 @@ busdisplay = false busio = false camera = false canio = false +circuitpython_typing = false codeop = false countio = false +cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false +gamepad = false +gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false +i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -66,11 +79,15 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false +multiterminal = false neopixel_write = false +network = false nvm = false onewireio = false os = true +paralleldisplay = false paralleldisplaybus = false +picodvi = false ps2io = false pulseio = false pwmio = false @@ -79,10 +96,13 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false +rp2pio = false rtc = false +samd = false sdcardio = false sdioio = false sharpdisplay = false +socket = false socketpool = false spitarget = false ssl = false @@ -96,6 +116,7 @@ time = true touchio = false traceback = false uheap = false +ulab = false usb = false usb_cdc = true usb_hid = false @@ -107,6 +128,7 @@ vectorio = false warnings = false watchdog = false wifi = false +wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml b/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml index d4fa229b7e67d..b91fcbdf9260b 100644 --- a/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml @@ -6,8 +6,10 @@ __future__ = false _bleio = false _eve = false _pew = false +_pixelbuf = false _pixelmap = false _stage = false +_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -19,6 +21,7 @@ audiobusio = false audiocore = false audiodelays = false audiofilters = false +audiofreeverb = false audioio = false audiomixer = false audiomp3 = false @@ -33,23 +36,33 @@ busdisplay = false busio = false camera = false canio = false +circuitpython_typing = false codeop = false countio = false +cyw43 = false digitalio = true displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false +esp32_camera = false +espcamera = false +espidf = false +espnow = false +espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false +gamepad = false +gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false +i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -66,11 +79,15 @@ memorymap = false memorymonitor = false microcontroller = true msgpack = false +multiterminal = false neopixel_write = false +network = false nvm = false onewireio = false os = true +paralleldisplay = false paralleldisplaybus = false +picodvi = false ps2io = false pulseio = false pwmio = false @@ -79,10 +96,13 @@ rainbowio = false random = true rgbmatrix = false rotaryio = false +rp2pio = false rtc = false +samd = false sdcardio = false sdioio = false sharpdisplay = false +socket = false socketpool = false spitarget = false ssl = false @@ -96,6 +116,7 @@ time = true touchio = false traceback = false uheap = false +ulab = false usb = false usb_cdc = false usb_hid = false @@ -107,6 +128,7 @@ vectorio = false warnings = false watchdog = false wifi = false +wiznet = false zephyr_kernel = false zephyr_serial = true zlib = false From b46532bf7991e37e711e6e5a1a7c9159001b5a6f Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sun, 20 Apr 2025 10:33:03 -0500 Subject: [PATCH 23/24] Oops old folders causing errors --- .../nordic/nrf5340dk/autogen_board_info.toml | 39 ++++------------ .../nordic/nrf54l15dk/autogen_board_info.toml | 37 ++++----------- .../nordic/nrf7002dk/autogen_board_info.toml | 45 +++++-------------- .../renesas/ek_ra6m5/autogen_board_info.toml | 39 ++++------------ .../renesas/ek_ra8d1/autogen_board_info.toml | 39 ++++------------ .../nucleo_u575zi_q/autogen_board_info.toml | 37 ++++----------- .../st/stm32h7b3i_dk/autogen_board_info.toml | 37 ++++----------- 7 files changed, 63 insertions(+), 210 deletions(-) diff --git a/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml index b0f5b30f6b1a7..6b652fdffee68 100644 --- a/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml @@ -6,10 +6,8 @@ __future__ = false _bleio = false _eve = false _pew = false -_pixelbuf = false _pixelmap = false _stage = false -_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -36,33 +34,23 @@ busdisplay = false busio = false camera = false canio = false -circuitpython_typing = false codeop = false countio = false -cyw43 = false -digitalio = true +digitalio = false displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false -gamepad = false -gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false -i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -77,48 +65,40 @@ max3421e = false mdns = false memorymap = false memorymonitor = false -microcontroller = true +microcontroller = false msgpack = false -multiterminal = false neopixel_write = false -network = false nvm = false onewireio = false -os = true -paralleldisplay = false +os = false paralleldisplaybus = false -picodvi = false ps2io = false pulseio = false pwmio = false qrio = false rainbowio = false -random = true +random = false rgbmatrix = false rotaryio = false -rp2pio = false rtc = false -samd = false sdcardio = false sdioio = false sharpdisplay = false -socket = false socketpool = false spitarget = false ssl = false -storage = true # Zephyr board has flash -struct = true +storage = false +struct = false supervisor = false synthio = false terminalio = false tilepalettemapper = false -time = true +time = false touchio = false traceback = false uheap = false -ulab = false usb = false -usb_cdc = true +usb_cdc = false usb_hid = false usb_host = false usb_midi = false @@ -128,7 +108,6 @@ vectorio = false warnings = false watchdog = false wifi = false -wiznet = false zephyr_kernel = false -zephyr_serial = true +zephyr_serial = false zlib = false diff --git a/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml index 3be836c4ad533..6d9b864bd0b07 100644 --- a/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml @@ -6,10 +6,8 @@ __future__ = false _bleio = false _eve = false _pew = false -_pixelbuf = false _pixelmap = false _stage = false -_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -36,33 +34,23 @@ busdisplay = false busio = false camera = false canio = false -circuitpython_typing = false codeop = false countio = false -cyw43 = false -digitalio = true +digitalio = false displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false -gamepad = false -gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false -i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -77,46 +65,38 @@ max3421e = false mdns = false memorymap = false memorymonitor = false -microcontroller = true +microcontroller = false msgpack = false -multiterminal = false neopixel_write = false -network = false nvm = false onewireio = false -os = true -paralleldisplay = false +os = false paralleldisplaybus = false -picodvi = false ps2io = false pulseio = false pwmio = false qrio = false rainbowio = false -random = true +random = false rgbmatrix = false rotaryio = false -rp2pio = false rtc = false -samd = false sdcardio = false sdioio = false sharpdisplay = false -socket = false socketpool = false spitarget = false ssl = false -storage = true # Zephyr board has flash -struct = true +storage = false +struct = false supervisor = false synthio = false terminalio = false tilepalettemapper = false -time = true +time = false touchio = false traceback = false uheap = false -ulab = false usb = false usb_cdc = false usb_hid = false @@ -128,7 +108,6 @@ vectorio = false warnings = false watchdog = false wifi = false -wiznet = false zephyr_kernel = false -zephyr_serial = true +zephyr_serial = false zlib = false diff --git a/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml index 040d40869a8e2..f0f80c9e88236 100644 --- a/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml @@ -6,10 +6,8 @@ __future__ = false _bleio = false _eve = false _pew = false -_pixelbuf = false _pixelmap = false _stage = false -_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -36,33 +34,23 @@ busdisplay = false busio = false camera = false canio = false -circuitpython_typing = false codeop = false countio = false -cyw43 = false -digitalio = true +digitalio = false displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false -gamepad = false -gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false -i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -77,48 +65,40 @@ max3421e = false mdns = false memorymap = false memorymonitor = false -microcontroller = true +microcontroller = false msgpack = false -multiterminal = false neopixel_write = false -network = false nvm = false onewireio = false -os = true -paralleldisplay = false +os = false paralleldisplaybus = false -picodvi = false ps2io = false pulseio = false pwmio = false qrio = false rainbowio = false -random = true +random = false rgbmatrix = false rotaryio = false -rp2pio = false rtc = false -samd = false sdcardio = false sdioio = false sharpdisplay = false -socket = false -socketpool = true # Zephyr networking enabled +socketpool = false spitarget = false -ssl = true # Zephyr networking enabled -storage = true # Zephyr board has flash -struct = true +ssl = false +storage = false +struct = false supervisor = false synthio = false terminalio = false tilepalettemapper = false -time = true +time = false touchio = false traceback = false uheap = false -ulab = false usb = false -usb_cdc = true +usb_cdc = false usb_hid = false usb_host = false usb_midi = false @@ -127,8 +107,7 @@ ustack = false vectorio = false warnings = false watchdog = false -wifi = true # Zephyr board has wifi -wiznet = false +wifi = false zephyr_kernel = false -zephyr_serial = true +zephyr_serial = false zlib = false diff --git a/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml b/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml index 716be21226825..b507153ac0c1c 100644 --- a/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml @@ -6,10 +6,8 @@ __future__ = false _bleio = false _eve = false _pew = false -_pixelbuf = false _pixelmap = false _stage = false -_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -36,33 +34,23 @@ busdisplay = false busio = false camera = false canio = false -circuitpython_typing = false codeop = false countio = false -cyw43 = false -digitalio = true +digitalio = false displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false -gamepad = false -gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false -i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -77,48 +65,40 @@ max3421e = false mdns = false memorymap = false memorymonitor = false -microcontroller = true +microcontroller = false msgpack = false -multiterminal = false neopixel_write = false -network = false nvm = false onewireio = false -os = true -paralleldisplay = false +os = false paralleldisplaybus = false -picodvi = false ps2io = false pulseio = false pwmio = false qrio = false rainbowio = false -random = true +random = false rgbmatrix = false rotaryio = false -rp2pio = false rtc = false -samd = false sdcardio = false sdioio = false sharpdisplay = false -socket = false socketpool = false spitarget = false ssl = false -storage = true # Zephyr board has flash -struct = true +storage = false +struct = false supervisor = false synthio = false terminalio = false tilepalettemapper = false -time = true +time = false touchio = false traceback = false uheap = false -ulab = false usb = false -usb_cdc = false # No TinyUSB settings for r7fa6m5bh3cfc +usb_cdc = false usb_hid = false usb_host = false usb_midi = false @@ -128,7 +108,6 @@ vectorio = false warnings = false watchdog = false wifi = false -wiznet = false zephyr_kernel = false -zephyr_serial = true +zephyr_serial = false zlib = false diff --git a/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml b/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml index ceb9e15dcc0d4..4a36a5fdb7923 100644 --- a/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml @@ -6,10 +6,8 @@ __future__ = false _bleio = false _eve = false _pew = false -_pixelbuf = false _pixelmap = false _stage = false -_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -36,33 +34,23 @@ busdisplay = false busio = false camera = false canio = false -circuitpython_typing = false codeop = false countio = false -cyw43 = false -digitalio = true +digitalio = false displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false -gamepad = false -gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false -i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -77,48 +65,40 @@ max3421e = false mdns = false memorymap = false memorymonitor = false -microcontroller = true +microcontroller = false msgpack = false -multiterminal = false neopixel_write = false -network = false nvm = false onewireio = false -os = true -paralleldisplay = false +os = false paralleldisplaybus = false -picodvi = false ps2io = false pulseio = false pwmio = false qrio = false rainbowio = false -random = true +random = false rgbmatrix = false rotaryio = false -rp2pio = false rtc = false -samd = false sdcardio = false sdioio = false sharpdisplay = false -socket = false socketpool = false spitarget = false ssl = false -storage = true # Zephyr board has flash -struct = true +storage = false +struct = false supervisor = false synthio = false terminalio = false tilepalettemapper = false -time = true +time = false touchio = false traceback = false uheap = false -ulab = false usb = false -usb_cdc = false # No TinyUSB settings for r7fa8d1bhecbd +usb_cdc = false usb_hid = false usb_host = false usb_midi = false @@ -128,7 +108,6 @@ vectorio = false warnings = false watchdog = false wifi = false -wiznet = false zephyr_kernel = false -zephyr_serial = true +zephyr_serial = false zlib = false diff --git a/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml b/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml index caa357a2319d9..73fa4623fe3d4 100644 --- a/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml @@ -6,10 +6,8 @@ __future__ = false _bleio = false _eve = false _pew = false -_pixelbuf = false _pixelmap = false _stage = false -_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -36,33 +34,23 @@ busdisplay = false busio = false camera = false canio = false -circuitpython_typing = false codeop = false countio = false -cyw43 = false -digitalio = true +digitalio = false displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false -gamepad = false -gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false -i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -77,48 +65,40 @@ max3421e = false mdns = false memorymap = false memorymonitor = false -microcontroller = true +microcontroller = false msgpack = false -multiterminal = false neopixel_write = false -network = false nvm = false onewireio = false -os = true -paralleldisplay = false +os = false paralleldisplaybus = false -picodvi = false ps2io = false pulseio = false pwmio = false qrio = false rainbowio = false -random = true +random = false rgbmatrix = false rotaryio = false -rp2pio = false rtc = false -samd = false sdcardio = false sdioio = false sharpdisplay = false -socket = false socketpool = false spitarget = false ssl = false storage = false -struct = true +struct = false supervisor = false synthio = false terminalio = false tilepalettemapper = false -time = true +time = false touchio = false traceback = false uheap = false -ulab = false usb = false -usb_cdc = true +usb_cdc = false usb_hid = false usb_host = false usb_midi = false @@ -128,7 +108,6 @@ vectorio = false warnings = false watchdog = false wifi = false -wiznet = false zephyr_kernel = false -zephyr_serial = true +zephyr_serial = false zlib = false diff --git a/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml b/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml index b91fcbdf9260b..b6ef6d757cdae 100644 --- a/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml @@ -6,10 +6,8 @@ __future__ = false _bleio = false _eve = false _pew = false -_pixelbuf = false _pixelmap = false _stage = false -_typing = false adafruit_bus_device = false adafruit_pixelbuf = false aesio = false @@ -36,33 +34,23 @@ busdisplay = false busio = false camera = false canio = false -circuitpython_typing = false codeop = false countio = false -cyw43 = false -digitalio = true +digitalio = false displayio = false dotclockframebuffer = false dualbank = false epaperdisplay = false -esp32_camera = false -espcamera = false -espidf = false -espnow = false -espulp = false floppyio = false fontio = false fourwire = false framebufferio = false frequencyio = false -gamepad = false -gamepadshift = false getpass = false gifio = false gnss = false hashlib = false i2cdisplaybus = false -i2cperipheral = false i2ctarget = false imagecapture = false ipaddress = false @@ -77,46 +65,38 @@ max3421e = false mdns = false memorymap = false memorymonitor = false -microcontroller = true +microcontroller = false msgpack = false -multiterminal = false neopixel_write = false -network = false nvm = false onewireio = false -os = true -paralleldisplay = false +os = false paralleldisplaybus = false -picodvi = false ps2io = false pulseio = false pwmio = false qrio = false rainbowio = false -random = true +random = false rgbmatrix = false rotaryio = false -rp2pio = false rtc = false -samd = false sdcardio = false sdioio = false sharpdisplay = false -socket = false socketpool = false spitarget = false ssl = false -storage = true # Zephyr board has flash -struct = true +storage = false +struct = false supervisor = false synthio = false terminalio = false tilepalettemapper = false -time = true +time = false touchio = false traceback = false uheap = false -ulab = false usb = false usb_cdc = false usb_hid = false @@ -128,7 +108,6 @@ vectorio = false warnings = false watchdog = false wifi = false -wiznet = false zephyr_kernel = false -zephyr_serial = true +zephyr_serial = false zlib = false From ca38d2986732f08d5e06e587a5513da8c788fc82 Mon Sep 17 00:00:00 2001 From: gamblor21 Date: Sun, 20 Apr 2025 10:41:27 -0500 Subject: [PATCH 24/24] Overwrite some autogen items incorrectly - fixed now --- .../nordic/nrf5340dk/autogen_board_info.toml | 18 +++++++------- .../nordic/nrf54l15dk/autogen_board_info.toml | 16 ++++++------- .../nordic/nrf7002dk/autogen_board_info.toml | 24 +++++++++---------- .../renesas/ek_ra6m5/autogen_board_info.toml | 18 +++++++------- .../renesas/ek_ra8d1/autogen_board_info.toml | 18 +++++++------- .../nucleo_u575zi_q/autogen_board_info.toml | 16 ++++++------- .../st/stm32h7b3i_dk/autogen_board_info.toml | 16 ++++++------- 7 files changed, 63 insertions(+), 63 deletions(-) diff --git a/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml index 6b652fdffee68..aecccebb9c850 100644 --- a/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml @@ -36,7 +36,7 @@ camera = false canio = false codeop = false countio = false -digitalio = false +digitalio = true displayio = false dotclockframebuffer = false dualbank = false @@ -65,19 +65,19 @@ max3421e = false mdns = false memorymap = false memorymonitor = false -microcontroller = false +microcontroller = true msgpack = false neopixel_write = false nvm = false onewireio = false -os = false +os = true paralleldisplaybus = false ps2io = false pulseio = false pwmio = false qrio = false rainbowio = false -random = false +random = true rgbmatrix = false rotaryio = false rtc = false @@ -87,18 +87,18 @@ sharpdisplay = false socketpool = false spitarget = false ssl = false -storage = false -struct = false +storage = true # Zephyr board has flash +struct = true supervisor = false synthio = false terminalio = false tilepalettemapper = false -time = false +time = true touchio = false traceback = false uheap = false usb = false -usb_cdc = false +usb_cdc = true usb_hid = false usb_host = false usb_midi = false @@ -109,5 +109,5 @@ warnings = false watchdog = false wifi = false zephyr_kernel = false -zephyr_serial = false +zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml index 6d9b864bd0b07..27e4f35f22366 100644 --- a/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml @@ -36,7 +36,7 @@ camera = false canio = false codeop = false countio = false -digitalio = false +digitalio = true displayio = false dotclockframebuffer = false dualbank = false @@ -65,19 +65,19 @@ max3421e = false mdns = false memorymap = false memorymonitor = false -microcontroller = false +microcontroller = true msgpack = false neopixel_write = false nvm = false onewireio = false -os = false +os = true paralleldisplaybus = false ps2io = false pulseio = false pwmio = false qrio = false rainbowio = false -random = false +random = true rgbmatrix = false rotaryio = false rtc = false @@ -87,13 +87,13 @@ sharpdisplay = false socketpool = false spitarget = false ssl = false -storage = false -struct = false +storage = true # Zephyr board has flash +struct = true supervisor = false synthio = false terminalio = false tilepalettemapper = false -time = false +time = true touchio = false traceback = false uheap = false @@ -109,5 +109,5 @@ warnings = false watchdog = false wifi = false zephyr_kernel = false -zephyr_serial = false +zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml index f0f80c9e88236..35e3791507023 100644 --- a/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml @@ -36,7 +36,7 @@ camera = false canio = false codeop = false countio = false -digitalio = false +digitalio = true displayio = false dotclockframebuffer = false dualbank = false @@ -65,40 +65,40 @@ max3421e = false mdns = false memorymap = false memorymonitor = false -microcontroller = false +microcontroller = true msgpack = false neopixel_write = false nvm = false onewireio = false -os = false +os = true paralleldisplaybus = false ps2io = false pulseio = false pwmio = false qrio = false rainbowio = false -random = false +random = true rgbmatrix = false rotaryio = false rtc = false sdcardio = false sdioio = false sharpdisplay = false -socketpool = false +socketpool = true # Zephyr networking enabled spitarget = false -ssl = false -storage = false -struct = false +ssl = true # Zephyr networking enabled +storage = true # Zephyr board has flash +struct = true supervisor = false synthio = false terminalio = false tilepalettemapper = false -time = false +time = true touchio = false traceback = false uheap = false usb = false -usb_cdc = false +usb_cdc = true usb_hid = false usb_host = false usb_midi = false @@ -107,7 +107,7 @@ ustack = false vectorio = false warnings = false watchdog = false -wifi = false +wifi = true # Zephyr board has wifi zephyr_kernel = false -zephyr_serial = false +zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml b/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml index b507153ac0c1c..4f4ee95bd0296 100644 --- a/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml @@ -36,7 +36,7 @@ camera = false canio = false codeop = false countio = false -digitalio = false +digitalio = true displayio = false dotclockframebuffer = false dualbank = false @@ -65,19 +65,19 @@ max3421e = false mdns = false memorymap = false memorymonitor = false -microcontroller = false +microcontroller = true msgpack = false neopixel_write = false nvm = false onewireio = false -os = false +os = true paralleldisplaybus = false ps2io = false pulseio = false pwmio = false qrio = false rainbowio = false -random = false +random = true rgbmatrix = false rotaryio = false rtc = false @@ -87,18 +87,18 @@ sharpdisplay = false socketpool = false spitarget = false ssl = false -storage = false -struct = false +storage = true # Zephyr board has flash +struct = true supervisor = false synthio = false terminalio = false tilepalettemapper = false -time = false +time = true touchio = false traceback = false uheap = false usb = false -usb_cdc = false +usb_cdc = false # No TinyUSB settings for r7fa6m5bh3cfc usb_hid = false usb_host = false usb_midi = false @@ -109,5 +109,5 @@ warnings = false watchdog = false wifi = false zephyr_kernel = false -zephyr_serial = false +zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml b/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml index 4a36a5fdb7923..90bb28c341ef6 100644 --- a/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml @@ -36,7 +36,7 @@ camera = false canio = false codeop = false countio = false -digitalio = false +digitalio = true displayio = false dotclockframebuffer = false dualbank = false @@ -65,19 +65,19 @@ max3421e = false mdns = false memorymap = false memorymonitor = false -microcontroller = false +microcontroller = true msgpack = false neopixel_write = false nvm = false onewireio = false -os = false +os = true paralleldisplaybus = false ps2io = false pulseio = false pwmio = false qrio = false rainbowio = false -random = false +random = true rgbmatrix = false rotaryio = false rtc = false @@ -87,18 +87,18 @@ sharpdisplay = false socketpool = false spitarget = false ssl = false -storage = false -struct = false +storage = true # Zephyr board has flash +struct = true supervisor = false synthio = false terminalio = false tilepalettemapper = false -time = false +time = true touchio = false traceback = false uheap = false usb = false -usb_cdc = false +usb_cdc = false # No TinyUSB settings for r7fa8d1bhecbd usb_hid = false usb_host = false usb_midi = false @@ -109,5 +109,5 @@ warnings = false watchdog = false wifi = false zephyr_kernel = false -zephyr_serial = false +zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml b/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml index 73fa4623fe3d4..c6fa66037a9ac 100644 --- a/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml @@ -36,7 +36,7 @@ camera = false canio = false codeop = false countio = false -digitalio = false +digitalio = true displayio = false dotclockframebuffer = false dualbank = false @@ -65,19 +65,19 @@ max3421e = false mdns = false memorymap = false memorymonitor = false -microcontroller = false +microcontroller = true msgpack = false neopixel_write = false nvm = false onewireio = false -os = false +os = true paralleldisplaybus = false ps2io = false pulseio = false pwmio = false qrio = false rainbowio = false -random = false +random = true rgbmatrix = false rotaryio = false rtc = false @@ -88,17 +88,17 @@ socketpool = false spitarget = false ssl = false storage = false -struct = false +struct = true supervisor = false synthio = false terminalio = false tilepalettemapper = false -time = false +time = true touchio = false traceback = false uheap = false usb = false -usb_cdc = false +usb_cdc = true usb_hid = false usb_host = false usb_midi = false @@ -109,5 +109,5 @@ warnings = false watchdog = false wifi = false zephyr_kernel = false -zephyr_serial = false +zephyr_serial = true zlib = false diff --git a/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml b/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml index b6ef6d757cdae..9e117262b3f91 100644 --- a/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml @@ -36,7 +36,7 @@ camera = false canio = false codeop = false countio = false -digitalio = false +digitalio = true displayio = false dotclockframebuffer = false dualbank = false @@ -65,19 +65,19 @@ max3421e = false mdns = false memorymap = false memorymonitor = false -microcontroller = false +microcontroller = true msgpack = false neopixel_write = false nvm = false onewireio = false -os = false +os = true paralleldisplaybus = false ps2io = false pulseio = false pwmio = false qrio = false rainbowio = false -random = false +random = true rgbmatrix = false rotaryio = false rtc = false @@ -87,13 +87,13 @@ sharpdisplay = false socketpool = false spitarget = false ssl = false -storage = false -struct = false +storage = true # Zephyr board has flash +struct = true supervisor = false synthio = false terminalio = false tilepalettemapper = false -time = false +time = true touchio = false traceback = false uheap = false @@ -109,5 +109,5 @@ warnings = false watchdog = false wifi = false zephyr_kernel = false -zephyr_serial = false +zephyr_serial = true zlib = false pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy