Skip to content

Add selective collect to memory allocations #10264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64JVxQ"
LONGINT_IMPL = MPZ

CIRCUITPY_AESIO = 0
CIRCUITPY_JPEGIO = 0
CIRCUITPY_SYNTHIO = 0
CIRCUITPY_TILEPALETTEMAPPER = 0
CIRCUITPY_CODEOP = 0
CIRCUITPY_EPAPERDISPLAY = 0
CIRCUITPY_FLOPPYIO = 0
CIRCUITPY_I2CDISPLAYBUS = 0
CIRCUITPY_I2CTARGET = 0
CIRCUITPY_PARALLELDISPLAYBUS = 0
CIRCUITPY_RGBMATRIX = 0
CIRCUITPY_SHARPDISPLAY = 0
CIRCUITPY_SPITARGET = 0
2 changes: 2 additions & 0 deletions ports/atmel-samd/boards/uartlogger2/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ CHIP_FAMILY = samd51
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = "W25Q32JVxQ"
LONGINT_IMPL = MPZ

CIRCUITPY_I2CTARGET = 0
CIRCUITPY_SPITARGET = 0
CIRCUITPY_SYNTHIO = 0
CIRCUITPY_JPEGIO = 0
Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/common-hal/pulseio/PulseIn.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self,
mp_raise_RuntimeError(MP_ERROR_TEXT("Internal resource(s) in use"));
}

self->buffer = (uint16_t *)m_malloc(maxlen * sizeof(uint16_t));
self->buffer = (uint16_t *)m_malloc_without_collect(maxlen * sizeof(uint16_t));
if (self->buffer == NULL) {
m_malloc_fail(maxlen * sizeof(uint16_t));
}
Expand Down
2 changes: 1 addition & 1 deletion ports/cxd56/common-hal/pulseio/PulseIn.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static int pulsein_interrupt_handler(int irq, FAR void *context, FAR void *arg)

void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self,
const mcu_pin_obj_t *pin, uint16_t maxlen, bool idle_state) {
self->buffer = (uint16_t *)m_malloc(maxlen * sizeof(uint16_t));
self->buffer = (uint16_t *)m_malloc_without_collect(maxlen * sizeof(uint16_t));
if (self->buffer == NULL) {
m_malloc_fail(maxlen * sizeof(uint16_t));
}
Expand Down
2 changes: 1 addition & 1 deletion ports/espressif/common-hal/_bleio/Characteristic.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self,
// If max_length is 0, then no storage is allocated.
if (max_length > 0) {
if (gc_alloc_possible()) {
self->current_value = m_malloc(max_length);
self->current_value = m_malloc_without_collect(max_length);
} else {
self->current_value = port_malloc(max_length, false);
if (self->current_value == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion ports/espressif/common-hal/_bleio/CharacteristicBuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void common_hal_bleio_characteristic_buffer_construct(bleio_characteristic_buffe
bleio_characteristic_obj_t *characteristic,
mp_float_t timeout,
size_t buffer_size) {
uint8_t *buffer = m_malloc(buffer_size);
uint8_t *buffer = m_malloc_without_collect(buffer_size);
_common_hal_bleio_characteristic_buffer_construct(self, characteristic, timeout, buffer, buffer_size, NULL, false);
}

Expand Down
6 changes: 3 additions & 3 deletions ports/espressif/common-hal/_bleio/PacketBuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,17 +240,17 @@ void common_hal_bleio_packet_buffer_construct(
uint32_t *incoming_buffer = NULL;
if (incoming) {
incoming_buffer_size = buffer_size * (sizeof(uint16_t) + max_packet_size);
incoming_buffer = m_malloc(incoming_buffer_size);
incoming_buffer = m_malloc_without_collect(incoming_buffer_size);
}

uint32_t *outgoing1 = NULL;
uint32_t *outgoing2 = NULL;
if (outgoing) {
outgoing1 = m_malloc(max_packet_size);
outgoing1 = m_malloc_without_collect(max_packet_size);
// Only allocate the second buffer if we are doing writes with responses.
// Without responses, we just write as quickly as we can.
if (outgoing == CHAR_PROP_WRITE || outgoing == CHAR_PROP_INDICATE) {
outgoing2 = m_malloc(max_packet_size);
outgoing2 = m_malloc_without_collect(max_packet_size);
}
}
_common_hal_bleio_packet_buffer_construct(self, characteristic,
Expand Down
2 changes: 1 addition & 1 deletion ports/espressif/common-hal/_bleio/ble_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void ble_event_add_handler(ble_gap_event_fn *func, void *param) {
}

// Add a new handler to the front of the list
ble_event_handler_entry_t *handler = m_new(ble_event_handler_entry_t, 1);
ble_event_handler_entry_t *handler = m_new_obj(ble_event_handler_entry_t);
ble_event_add_handler_entry(handler, func, param);
}

Expand Down
24 changes: 12 additions & 12 deletions ports/espressif/common-hal/audioio/AudioOut.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static bool audioout_convert_u8s_u8m(

bool buffer_changed = false;
if (in_buffer_size / 2 > *out_buffer_size) {
*out_buffer = m_malloc(in_buffer_size / 2);
*out_buffer = m_malloc_without_collect(in_buffer_size / 2);
buffer_changed = true;
}
audiosample_convert_u8s_u8m(*out_buffer, (uint8_t *)in_buffer, in_buffer_size / 2);
Expand All @@ -58,7 +58,7 @@ static bool audioout_convert_u8m_u8s(

bool buffer_changed = false;
if (in_buffer_size * 2 > *out_buffer_size) {
*out_buffer = m_malloc(in_buffer_size * 2);
*out_buffer = m_malloc_without_collect(in_buffer_size * 2);
buffer_changed = true;
}
audiosample_convert_u8m_u8s(*out_buffer, (uint8_t *)in_buffer, in_buffer_size);
Expand All @@ -74,7 +74,7 @@ static bool audioout_convert_s8m_u8m(

bool buffer_changed = false;
if (in_buffer_size > *out_buffer_size) {
*out_buffer = m_malloc(in_buffer_size);
*out_buffer = m_malloc_without_collect(in_buffer_size);
buffer_changed = true;
}
audiosample_convert_s8m_u8m(*out_buffer, (int8_t *)in_buffer, in_buffer_size);
Expand All @@ -90,7 +90,7 @@ static bool audioout_convert_s8s_u8m(

bool buffer_changed = false;
if (in_buffer_size / 2 > *out_buffer_size) {
*out_buffer = m_malloc(in_buffer_size / 2);
*out_buffer = m_malloc_without_collect(in_buffer_size / 2);
buffer_changed = true;
}
audiosample_convert_s8s_u8m(*out_buffer, (int8_t *)in_buffer, in_buffer_size / 2);
Expand All @@ -106,7 +106,7 @@ static bool audioout_convert_s8m_u8s(

bool buffer_changed = false;
if (in_buffer_size * 2 > *out_buffer_size) {
*out_buffer = m_malloc(in_buffer_size * 2);
*out_buffer = m_malloc_without_collect(in_buffer_size * 2);
buffer_changed = true;
}
audiosample_convert_s8m_u8s(*out_buffer, (int8_t *)in_buffer, in_buffer_size);
Expand All @@ -122,7 +122,7 @@ static bool audioout_convert_s8s_u8s(

bool buffer_changed = false;
if (in_buffer_size > *out_buffer_size) {
*out_buffer = m_malloc(in_buffer_size);
*out_buffer = m_malloc_without_collect(in_buffer_size);
buffer_changed = true;
}
audiosample_convert_s8s_u8s(*out_buffer, (int8_t *)in_buffer, in_buffer_size);
Expand All @@ -138,7 +138,7 @@ static bool audioout_convert_u16m_u8m(

bool buffer_changed = false;
if (in_buffer_size / 2 > *out_buffer_size) {
*out_buffer = m_malloc(in_buffer_size / 2);
*out_buffer = m_malloc_without_collect(in_buffer_size / 2);
buffer_changed = true;
}
audiosample_convert_u16m_u8m(*out_buffer, (uint16_t *)in_buffer, in_buffer_size / 2);
Expand All @@ -154,7 +154,7 @@ static bool audioout_convert_u16m_u8s(

bool buffer_changed = false;
if (in_buffer_size > *out_buffer_size) {
*out_buffer = m_malloc(in_buffer_size);
*out_buffer = m_malloc_without_collect(in_buffer_size);
buffer_changed = true;
}
audiosample_convert_u16m_u8s(*out_buffer, (uint16_t *)in_buffer, in_buffer_size / 2);
Expand Down Expand Up @@ -186,7 +186,7 @@ static bool audioout_convert_u16s_u8s(

bool buffer_changed = false;
if (in_buffer_size / 2 > *out_buffer_size) {
*out_buffer = m_malloc(in_buffer_size / 2);
*out_buffer = m_malloc_without_collect(in_buffer_size / 2);
buffer_changed = true;
}
audiosample_convert_u16s_u8s(*out_buffer, (uint16_t *)in_buffer, in_buffer_size / 4);
Expand All @@ -202,7 +202,7 @@ static bool audioout_convert_s16m_u8m(

bool buffer_changed = false;
if (in_buffer_size / 2 > *out_buffer_size) {
*out_buffer = m_malloc(in_buffer_size / 2);
*out_buffer = m_malloc_without_collect(in_buffer_size / 2);
buffer_changed = true;
}
audiosample_convert_s16m_u8m(*out_buffer, (int16_t *)in_buffer, in_buffer_size / 2);
Expand All @@ -218,7 +218,7 @@ static bool audioout_convert_s16m_u8s(

bool buffer_changed = false;
if (in_buffer_size > *out_buffer_size) {
*out_buffer = m_malloc(in_buffer_size);
*out_buffer = m_malloc_without_collect(in_buffer_size);
buffer_changed = true;
}
audiosample_convert_s16m_u8s(*out_buffer, (int16_t *)in_buffer, in_buffer_size / 2);
Expand Down Expand Up @@ -250,7 +250,7 @@ static bool audioout_convert_s16s_u8s(

bool buffer_changed = false;
if (in_buffer_size / 2 > *out_buffer_size) {
*out_buffer = m_malloc(in_buffer_size / 2);
*out_buffer = m_malloc_without_collect(in_buffer_size / 2);
buffer_changed = true;
}
audiosample_convert_s16s_u8s(*out_buffer, (int16_t *)in_buffer, in_buffer_size / 4);
Expand Down
2 changes: 1 addition & 1 deletion ports/espressif/common-hal/nvm/ByteArray.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static esp_err_t get_bytes(nvs_handle_t handle, uint8_t **buf_out) {
*buf_out = NULL;
return result;
}
buf = m_malloc(size); // this SHOULD be the same as
buf = m_malloc_without_collect(size); // this SHOULD be the same as
if (result == ESP_OK) {
result = nvs_get_blob(handle, "data", buf, &size);
} else {
Expand Down
4 changes: 2 additions & 2 deletions ports/espressif/common-hal/pulseio/PulseIn.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ static bool _done_callback(rmt_channel_handle_t rx_chan,

void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, const mcu_pin_obj_t *pin,
uint16_t maxlen, bool idle_state) {
self->buffer = (uint16_t *)m_malloc(maxlen * sizeof(uint16_t));
self->buffer = (uint16_t *)m_malloc_without_collect(maxlen * sizeof(uint16_t));
if (self->buffer == NULL) {
m_malloc_fail(maxlen * sizeof(uint16_t));
}
// We add one to the maxlen version to ensure that two symbols at lease are
// captured because we may skip the first portion of a symbol.
self->raw_symbols_size = MIN(64, maxlen / 2 + 1) * sizeof(rmt_symbol_word_t);
self->raw_symbols = (rmt_symbol_word_t *)m_malloc(self->raw_symbols_size);
self->raw_symbols = (rmt_symbol_word_t *)m_malloc_without_collect(self->raw_symbols_size);
if (self->raw_symbols == NULL) {
m_free(self->buffer);
m_malloc_fail(self->raw_symbols_size);
Expand Down
3 changes: 3 additions & 0 deletions ports/espressif/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
#define MICROPY_NLR_SETJMP (1)
#define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000

// PSRAM can require more stack space for GC.
#define MICROPY_ALLOC_GC_STACK_SIZE (128)

// Nearly all boards have this because it is used to enter the ROM bootloader.
#ifndef CIRCUITPY_BOOT_BUTTON
#if defined(CONFIG_IDF_TARGET_ESP32C2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32H2)
Expand Down
2 changes: 1 addition & 1 deletion ports/mimxrt10xx/common-hal/audiobusio/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ void port_i2s_initialize(i2s_t *self, int instance, sai_transceiver_t *config) {
mp_raise_ValueError_varg(MP_ERROR_TEXT("Invalid %q"), MP_QSTR_I2SOut);
}
for (size_t i = 0; i < MP_ARRAY_SIZE(self->buffers); i++) {
self->buffers[i] = m_malloc(AUDIO_BUFFER_FRAME_COUNT * sizeof(uint32_t));
self->buffers[i] = m_malloc_without_collect(AUDIO_BUFFER_FRAME_COUNT * sizeof(uint32_t));
}
self->peripheral = peripheral;
SAI_Init(self->peripheral);
Expand Down
2 changes: 1 addition & 1 deletion ports/mimxrt10xx/common-hal/canio/CAN.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, const mcu_pin_obj_t *
self->silent = silent;
self->baudrate = baudrate;

self->data = m_new_obj(mimxrt10xx_flexcan_data_t);
self->data = m_malloc_without_collect(sizeof(mimxrt10xx_flexcan_data_t));
self->data->base = flexcan_bases[instance]; // 'flexcan_bases' start indexing from 1. (The first element is NULL)
self->data->tx_state = 0;

Expand Down
13 changes: 7 additions & 6 deletions ports/mimxrt10xx/common-hal/canio/Listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,13 @@ mp_obj_t common_hal_canio_listener_receive(canio_listener_obj_t *self) {
// allows the CPU to serve the next FIFO entry
FLEXCAN_ClearMbStatusFlags(self->can->data->base, (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag);

canio_message_obj_t *message = m_new_obj(canio_message_obj_t);
const mp_obj_type_t *type;
if (rx_frame.type == kFLEXCAN_FrameTypeRemote) {
type = &canio_remote_transmission_request_type;
} else {
type = &canio_message_type;
}
canio_message_obj_t *message = mp_obj_malloc(canio_message_obj_t, type);
memset(message, 0, sizeof(canio_message_obj_t));

if (rx_frame.format == kFLEXCAN_FrameFormatExtend) {
Expand All @@ -134,11 +140,6 @@ mp_obj_t common_hal_canio_listener_receive(canio_listener_obj_t *self) {
message->id = rx_frame.id >> 18; // standard ids are left-aligned
}

if (rx_frame.type == kFLEXCAN_FrameTypeRemote) {
message->base.type = &canio_remote_transmission_request_type;
} else {
message->base.type = &canio_message_type;
}

message->size = rx_frame.length;

Expand Down
2 changes: 1 addition & 1 deletion ports/nordic/common-hal/_bleio/Adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t
}
self->scan_results = shared_module_bleio_new_scanresults(buffer_size, prefixes, prefix_length, minimum_rssi);
size_t max_packet_size = extended ? BLE_GAP_SCAN_BUFFER_EXTENDED_MAX_SUPPORTED : BLE_GAP_SCAN_BUFFER_MAX;
uint8_t *raw_data = m_malloc(sizeof(ble_data_t) + max_packet_size);
uint8_t *raw_data = m_malloc_without_collect(sizeof(ble_data_t) + max_packet_size);
ble_data_t *sd_data = (ble_data_t *)raw_data;
self->scan_results->common_hal_data = sd_data;
sd_data->len = max_packet_size;
Expand Down
2 changes: 1 addition & 1 deletion ports/nordic/common-hal/_bleio/Characteristic.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self,
self->initial_value_len = initial_value_bufinfo->len;
if (gc_alloc_possible()) {
if (gc_nbytes(initial_value_bufinfo->buf) > 0) {
uint8_t *initial_value = m_malloc(self->initial_value_len);
uint8_t *initial_value = m_malloc_without_collect(self->initial_value_len);
memcpy(initial_value, initial_value_bufinfo->buf, self->initial_value_len);
self->initial_value = initial_value;
} else {
Expand Down
2 changes: 1 addition & 1 deletion ports/nordic/common-hal/_bleio/CharacteristicBuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void common_hal_bleio_characteristic_buffer_construct(bleio_characteristic_buffe
bleio_characteristic_obj_t *characteristic,
mp_float_t timeout,
size_t buffer_size) {
uint8_t *buffer = m_malloc(buffer_size);
uint8_t *buffer = m_malloc_without_collect(buffer_size);
_common_hal_bleio_characteristic_buffer_construct(self, characteristic, timeout, buffer, buffer_size, NULL, false);
}

Expand Down
6 changes: 3 additions & 3 deletions ports/nordic/common-hal/_bleio/PacketBuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,14 @@ void common_hal_bleio_packet_buffer_construct(
uint32_t *incoming_buffer = NULL;
if (incoming) {
incoming_buffer_size = buffer_size * (sizeof(uint16_t) + max_packet_size);
incoming_buffer = m_malloc(incoming_buffer_size);
incoming_buffer = m_malloc_without_collect(incoming_buffer_size);
}

uint32_t *outgoing1 = NULL;
uint32_t *outgoing2 = NULL;
if (outgoing) {
outgoing1 = m_malloc(max_packet_size);
outgoing2 = m_malloc(max_packet_size);
outgoing1 = m_malloc_without_collect(max_packet_size);
outgoing2 = m_malloc_without_collect(max_packet_size);
}
_common_hal_bleio_packet_buffer_construct(self, characteristic,
incoming_buffer, incoming_buffer_size,
Expand Down
4 changes: 2 additions & 2 deletions ports/nordic/common-hal/audiobusio/I2SOut.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t *self,
self->buffer_length = sample_rate * buffer_length_ms
* self->bytes_per_sample * self->channel_count / 1000;
self->buffer_length = (self->buffer_length + 3) & ~3;
self->buffers[0] = m_malloc(self->buffer_length);
self->buffers[1] = m_malloc(self->buffer_length);
self->buffers[0] = m_malloc_without_collect(self->buffer_length);
self->buffers[1] = m_malloc_without_collect(self->buffer_length);


audiosample_reset_buffer(self->sample, false, 0);
Expand Down
4 changes: 2 additions & 2 deletions ports/nordic/common-hal/audiopwmio/PWMAudioOut.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,13 @@ void common_hal_audiopwmio_pwmaudioout_play(audiopwmio_pwmaudioout_obj_t *self,

size_t buffer_size = (size_t)max_buffer_length * 2 * sizeof(uint16_t);

self->buffers[0] = m_malloc(buffer_size);
self->buffers[0] = m_malloc_without_collect(buffer_size);
#if MICROPY_MALLOC_USES_ALLOCATED_SIZE
self->buffer_size[0] = buffer_size;
#endif

if (!self->single_buffer) {
self->buffers[1] = m_malloc(buffer_size);
self->buffers[1] = m_malloc_without_collect(buffer_size);
#if MICROPY_MALLOC_USES_ALLOCATED_SIZE
self->buffer_size[1] = buffer_size;
#endif
Expand Down
2 changes: 1 addition & 1 deletion ports/nordic/common-hal/busio/UART.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data,
if (!nrfx_is_in_ram(data)) {
// Allocate long strings on the heap.
if (len > 128 && gc_alloc_possible()) {
tx_buf = (uint8_t *)m_malloc(len);
tx_buf = (uint8_t *)m_malloc_without_collect(len);
} else {
tx_buf = alloca(len);
}
Expand Down
2 changes: 1 addition & 1 deletion ports/nordic/common-hal/pulseio/PulseIn.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, const mcu
}
_objs[idx] = self;

self->buffer = (uint16_t *)m_malloc(maxlen * sizeof(uint16_t));
self->buffer = (uint16_t *)m_malloc_without_collect(maxlen * sizeof(uint16_t));
if (self->buffer == NULL) {
m_malloc_fail(maxlen * sizeof(uint16_t));
}
Expand Down
4 changes: 2 additions & 2 deletions ports/raspberrypi/boards/adafruit_fruit_jam/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

#define I2S_RESET_PIN_NUMBER 22

#if defined(DEFAULT_USB_HOST_5V_POWER)
bool board_reset_pin_number(uint8_t pin_number) {
#if defined(DEFAULT_USB_HOST_5V_POWER)
if (pin_number == DEFAULT_USB_HOST_5V_POWER->number) {
// doing this (rather than gpio_init) in this specific order ensures no
// glitch if pin was already configured as a high output. gpio_init() temporarily
Expand All @@ -29,6 +29,7 @@ bool board_reset_pin_number(uint8_t pin_number) {

return true;
}
#endif
// Set I2S out of reset.
if (pin_number == I2S_RESET_PIN_NUMBER) {
gpio_put(pin_number, 1);
Expand All @@ -39,7 +40,6 @@ bool board_reset_pin_number(uint8_t pin_number) {
}
return false;
}
#endif

void board_init(void) {
// Reset the DAC to put it in a known state.
Expand Down
Loading
Loading