Skip to content

Commit 100f131

Browse files
committed
Merge remote-tracking branch 'adafruit/main' into fix_thonny_after_cwd_change
2 parents 8a28033 + fa9b974 commit 100f131

File tree

88 files changed

+487
-284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+487
-284
lines changed

locale/en_GB.po

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: PACKAGE VERSION\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"PO-Revision-Date: 2025-04-19 15:42+0000\n"
10+
"PO-Revision-Date: 2025-04-25 15:04+0000\n"
1111
"Last-Translator: Andi Chandler <[email protected]>\n"
1212
"Language-Team: none\n"
1313
"Language: en_GB\n"
1414
"MIME-Version: 1.0\n"
1515
"Content-Type: text/plain; charset=UTF-8\n"
1616
"Content-Transfer-Encoding: 8bit\n"
1717
"Plural-Forms: nplurals=2; plural=n != 1;\n"
18-
"X-Generator: Weblate 5.11.1-dev\n"
18+
"X-Generator: Weblate 5.12-dev\n"
1919

2020
#: main.c
2121
msgid ""
@@ -117,7 +117,7 @@ msgstr "%q failure: %d"
117117

118118
#: shared-module/audiodelays/MultiTapDelay.c
119119
msgid "%q in %q must be of type %q or %q, not %q"
120-
msgstr ""
120+
msgstr "%q in %q must be of type %q or %q, not %q"
121121

122122
#: py/argcheck.c shared-module/audiofilters/Filter.c
123123
msgid "%q in %q must be of type %q, not %q"
@@ -2630,7 +2630,7 @@ msgstr "bits must be 32 or less"
26302630
#: shared-bindings/audiofilters/Distortion.c
26312631
#: shared-bindings/audiodelays/Reverb.c
26322632
msgid "bits_per_sample must be 16"
2633-
msgstr ""
2633+
msgstr "bits_per_sample must be 16"
26342634

26352635
#: shared-bindings/audiodelays/Echo.c shared-bindings/audiofilters/Distortion.c
26362636
#: shared-bindings/audiofilters/Filter.c shared-bindings/audiomixer/Mixer.c
@@ -4055,7 +4055,7 @@ msgstr "rsplit(None,n)"
40554055

40564056
#: shared-bindings/audiodelays/Reverb.c
40574057
msgid "samples_signed must be true"
4058-
msgstr ""
4058+
msgstr "samples_signed must be true"
40594059

40604060
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
40614061
#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c

locale/zh_Latn_pinyin.po

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ msgstr ""
77
"Project-Id-Version: circuitpython-cn\n"
88
"Report-Msgid-Bugs-To: \n"
99
"POT-Creation-Date: 2021-01-04 12:55-0600\n"
10-
"PO-Revision-Date: 2025-04-10 22:01+0000\n"
10+
"PO-Revision-Date: 2025-04-25 15:04+0000\n"
1111
"Last-Translator: hexthat <[email protected]>\n"
1212
"Language-Team: Chinese Hanyu Pinyin\n"
1313
"Language: zh_Latn_pinyin\n"
1414
"MIME-Version: 1.0\n"
1515
"Content-Type: text/plain; charset=UTF-8\n"
1616
"Content-Transfer-Encoding: 8bit\n"
1717
"Plural-Forms: nplurals=1; plural=0;\n"
18-
"X-Generator: Weblate 5.11-dev\n"
18+
"X-Generator: Weblate 5.12-dev\n"
1919

2020
#: main.c
2121
msgid ""
@@ -118,7 +118,7 @@ msgstr "%q Shībài: %d"
118118

119119
#: shared-module/audiodelays/MultiTapDelay.c
120120
msgid "%q in %q must be of type %q or %q, not %q"
121-
msgstr ""
121+
msgstr "%q zhōngde %q bìxū shì %q huò %q lèixíng, érbùshì %q"
122122

123123
#: py/argcheck.c shared-module/audiofilters/Filter.c
124124
msgid "%q in %q must be of type %q, not %q"
@@ -2648,7 +2648,7 @@ msgstr "wèi bì xū shì 32 huò gèng shǎo"
26482648
#: shared-bindings/audiofilters/Distortion.c
26492649
#: shared-bindings/audiodelays/Reverb.c
26502650
msgid "bits_per_sample must be 16"
2651-
msgstr ""
2651+
msgstr "bits_per_sample bìxū wèi 16"
26522652

26532653
#: shared-bindings/audiodelays/Echo.c shared-bindings/audiofilters/Distortion.c
26542654
#: shared-bindings/audiofilters/Filter.c shared-bindings/audiomixer/Mixer.c
@@ -4077,7 +4077,7 @@ msgstr "Rchāifēn(wú,N)"
40774077

40784078
#: shared-bindings/audiodelays/Reverb.c
40794079
msgid "samples_signed must be true"
4080-
msgstr ""
4080+
msgstr "samples_signed bìxū wéi zhēn"
40814081

40824082
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
40834083
#: ports/raspberrypi/common-hal/audiobusio/PDMIn.c

ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64JVxQ"
1111
LONGINT_IMPL = MPZ
1212

1313
CIRCUITPY_AESIO = 0
14-
CIRCUITPY_JPEGIO = 0
15-
CIRCUITPY_SYNTHIO = 0
16-
CIRCUITPY_TILEPALETTEMAPPER = 0
14+
CIRCUITPY_CODEOP = 0
15+
CIRCUITPY_EPAPERDISPLAY = 0
16+
CIRCUITPY_FLOPPYIO = 0
17+
CIRCUITPY_I2CDISPLAYBUS = 0
18+
CIRCUITPY_I2CTARGET = 0
19+
CIRCUITPY_PARALLELDISPLAYBUS = 0
20+
CIRCUITPY_RGBMATRIX = 0
21+
CIRCUITPY_SHARPDISPLAY = 0
22+
CIRCUITPY_SPITARGET = 0

ports/atmel-samd/boards/uartlogger2/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ CHIP_FAMILY = samd51
99
QSPI_FLASH_FILESYSTEM = 1
1010
EXTERNAL_FLASH_DEVICES = "W25Q32JVxQ"
1111
LONGINT_IMPL = MPZ
12+
13+
CIRCUITPY_I2CTARGET = 0
1214
CIRCUITPY_SPITARGET = 0
1315
CIRCUITPY_SYNTHIO = 0
1416
CIRCUITPY_JPEGIO = 0

ports/atmel-samd/common-hal/pulseio/PulseIn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self,
130130
mp_raise_RuntimeError(MP_ERROR_TEXT("Internal resource(s) in use"));
131131
}
132132

133-
self->buffer = (uint16_t *)m_malloc(maxlen * sizeof(uint16_t));
133+
self->buffer = (uint16_t *)m_malloc_without_collect(maxlen * sizeof(uint16_t));
134134
if (self->buffer == NULL) {
135135
m_malloc_fail(maxlen * sizeof(uint16_t));
136136
}

ports/cxd56/common-hal/pulseio/PulseIn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static int pulsein_interrupt_handler(int irq, FAR void *context, FAR void *arg)
6565

6666
void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self,
6767
const mcu_pin_obj_t *pin, uint16_t maxlen, bool idle_state) {
68-
self->buffer = (uint16_t *)m_malloc(maxlen * sizeof(uint16_t));
68+
self->buffer = (uint16_t *)m_malloc_without_collect(maxlen * sizeof(uint16_t));
6969
if (self->buffer == NULL) {
7070
m_malloc_fail(maxlen * sizeof(uint16_t));
7171
}

ports/espressif/Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,19 @@ CFLAGS += \
360360
-DCFG_TUD_TASK_QUEUE_SZ=32
361361
endif
362362
ifeq ($(CIRCUITPY_USB_DEVICE),1)
363+
ifeq ($(IDF_TARGET),esp32s2)
364+
# Make more room in internal RAM on the S2.
365+
CFLAGS += \
366+
-DCFG_TUD_CDC_RX_BUFSIZE=128 \
367+
-DCFG_TUD_CDC_TX_BUFSIZE=128 \
368+
-DCFG_TUD_MSC_BUFSIZE=1024
369+
else
363370
CFLAGS += \
364371
-DCFG_TUD_CDC_RX_BUFSIZE=1024 \
365372
-DCFG_TUD_CDC_TX_BUFSIZE=1024 \
366-
-DCFG_TUD_MSC_BUFSIZE=4096 \
373+
-DCFG_TUD_MSC_BUFSIZE=4096
374+
endif
375+
CFLAGS += \
367376
-DCFG_TUD_MIDI_RX_BUFSIZE=128 \
368377
-DCFG_TUD_MIDI_TX_BUFSIZE=128 \
369378
-DCFG_TUD_VENDOR_RX_BUFSIZE=128 \

ports/espressif/common-hal/_bleio/Characteristic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self,
7878
// If max_length is 0, then no storage is allocated.
7979
if (max_length > 0) {
8080
if (gc_alloc_possible()) {
81-
self->current_value = m_malloc(max_length);
81+
self->current_value = m_malloc_without_collect(max_length);
8282
} else {
8383
self->current_value = port_malloc(max_length, false);
8484
if (self->current_value == NULL) {

ports/espressif/common-hal/_bleio/CharacteristicBuffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void common_hal_bleio_characteristic_buffer_construct(bleio_characteristic_buffe
5454
bleio_characteristic_obj_t *characteristic,
5555
mp_float_t timeout,
5656
size_t buffer_size) {
57-
uint8_t *buffer = m_malloc(buffer_size);
57+
uint8_t *buffer = m_malloc_without_collect(buffer_size);
5858
_common_hal_bleio_characteristic_buffer_construct(self, characteristic, timeout, buffer, buffer_size, NULL, false);
5959
}
6060

ports/espressif/common-hal/_bleio/PacketBuffer.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,17 +240,17 @@ void common_hal_bleio_packet_buffer_construct(
240240
uint32_t *incoming_buffer = NULL;
241241
if (incoming) {
242242
incoming_buffer_size = buffer_size * (sizeof(uint16_t) + max_packet_size);
243-
incoming_buffer = m_malloc(incoming_buffer_size);
243+
incoming_buffer = m_malloc_without_collect(incoming_buffer_size);
244244
}
245245

246246
uint32_t *outgoing1 = NULL;
247247
uint32_t *outgoing2 = NULL;
248248
if (outgoing) {
249-
outgoing1 = m_malloc(max_packet_size);
249+
outgoing1 = m_malloc_without_collect(max_packet_size);
250250
// Only allocate the second buffer if we are doing writes with responses.
251251
// Without responses, we just write as quickly as we can.
252252
if (outgoing == CHAR_PROP_WRITE || outgoing == CHAR_PROP_INDICATE) {
253-
outgoing2 = m_malloc(max_packet_size);
253+
outgoing2 = m_malloc_without_collect(max_packet_size);
254254
}
255255
}
256256
_common_hal_bleio_packet_buffer_construct(self, characteristic,

ports/espressif/common-hal/_bleio/ble_events.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void ble_event_add_handler(ble_gap_event_fn *func, void *param) {
6464
}
6565

6666
// Add a new handler to the front of the list
67-
ble_event_handler_entry_t *handler = m_new(ble_event_handler_entry_t, 1);
67+
ble_event_handler_entry_t *handler = m_new_obj(ble_event_handler_entry_t);
6868
ble_event_add_handler_entry(handler, func, param);
6969
}
7070

ports/espressif/common-hal/audioio/AudioOut.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static bool audioout_convert_u8s_u8m(
4242

4343
bool buffer_changed = false;
4444
if (in_buffer_size / 2 > *out_buffer_size) {
45-
*out_buffer = m_malloc(in_buffer_size / 2);
45+
*out_buffer = m_malloc_without_collect(in_buffer_size / 2);
4646
buffer_changed = true;
4747
}
4848
audiosample_convert_u8s_u8m(*out_buffer, (uint8_t *)in_buffer, in_buffer_size / 2);
@@ -58,7 +58,7 @@ static bool audioout_convert_u8m_u8s(
5858

5959
bool buffer_changed = false;
6060
if (in_buffer_size * 2 > *out_buffer_size) {
61-
*out_buffer = m_malloc(in_buffer_size * 2);
61+
*out_buffer = m_malloc_without_collect(in_buffer_size * 2);
6262
buffer_changed = true;
6363
}
6464
audiosample_convert_u8m_u8s(*out_buffer, (uint8_t *)in_buffer, in_buffer_size);
@@ -74,7 +74,7 @@ static bool audioout_convert_s8m_u8m(
7474

7575
bool buffer_changed = false;
7676
if (in_buffer_size > *out_buffer_size) {
77-
*out_buffer = m_malloc(in_buffer_size);
77+
*out_buffer = m_malloc_without_collect(in_buffer_size);
7878
buffer_changed = true;
7979
}
8080
audiosample_convert_s8m_u8m(*out_buffer, (int8_t *)in_buffer, in_buffer_size);
@@ -90,7 +90,7 @@ static bool audioout_convert_s8s_u8m(
9090

9191
bool buffer_changed = false;
9292
if (in_buffer_size / 2 > *out_buffer_size) {
93-
*out_buffer = m_malloc(in_buffer_size / 2);
93+
*out_buffer = m_malloc_without_collect(in_buffer_size / 2);
9494
buffer_changed = true;
9595
}
9696
audiosample_convert_s8s_u8m(*out_buffer, (int8_t *)in_buffer, in_buffer_size / 2);
@@ -106,7 +106,7 @@ static bool audioout_convert_s8m_u8s(
106106

107107
bool buffer_changed = false;
108108
if (in_buffer_size * 2 > *out_buffer_size) {
109-
*out_buffer = m_malloc(in_buffer_size * 2);
109+
*out_buffer = m_malloc_without_collect(in_buffer_size * 2);
110110
buffer_changed = true;
111111
}
112112
audiosample_convert_s8m_u8s(*out_buffer, (int8_t *)in_buffer, in_buffer_size);
@@ -122,7 +122,7 @@ static bool audioout_convert_s8s_u8s(
122122

123123
bool buffer_changed = false;
124124
if (in_buffer_size > *out_buffer_size) {
125-
*out_buffer = m_malloc(in_buffer_size);
125+
*out_buffer = m_malloc_without_collect(in_buffer_size);
126126
buffer_changed = true;
127127
}
128128
audiosample_convert_s8s_u8s(*out_buffer, (int8_t *)in_buffer, in_buffer_size);
@@ -138,7 +138,7 @@ static bool audioout_convert_u16m_u8m(
138138

139139
bool buffer_changed = false;
140140
if (in_buffer_size / 2 > *out_buffer_size) {
141-
*out_buffer = m_malloc(in_buffer_size / 2);
141+
*out_buffer = m_malloc_without_collect(in_buffer_size / 2);
142142
buffer_changed = true;
143143
}
144144
audiosample_convert_u16m_u8m(*out_buffer, (uint16_t *)in_buffer, in_buffer_size / 2);
@@ -154,7 +154,7 @@ static bool audioout_convert_u16m_u8s(
154154

155155
bool buffer_changed = false;
156156
if (in_buffer_size > *out_buffer_size) {
157-
*out_buffer = m_malloc(in_buffer_size);
157+
*out_buffer = m_malloc_without_collect(in_buffer_size);
158158
buffer_changed = true;
159159
}
160160
audiosample_convert_u16m_u8s(*out_buffer, (uint16_t *)in_buffer, in_buffer_size / 2);
@@ -186,7 +186,7 @@ static bool audioout_convert_u16s_u8s(
186186

187187
bool buffer_changed = false;
188188
if (in_buffer_size / 2 > *out_buffer_size) {
189-
*out_buffer = m_malloc(in_buffer_size / 2);
189+
*out_buffer = m_malloc_without_collect(in_buffer_size / 2);
190190
buffer_changed = true;
191191
}
192192
audiosample_convert_u16s_u8s(*out_buffer, (uint16_t *)in_buffer, in_buffer_size / 4);
@@ -202,7 +202,7 @@ static bool audioout_convert_s16m_u8m(
202202

203203
bool buffer_changed = false;
204204
if (in_buffer_size / 2 > *out_buffer_size) {
205-
*out_buffer = m_malloc(in_buffer_size / 2);
205+
*out_buffer = m_malloc_without_collect(in_buffer_size / 2);
206206
buffer_changed = true;
207207
}
208208
audiosample_convert_s16m_u8m(*out_buffer, (int16_t *)in_buffer, in_buffer_size / 2);
@@ -218,7 +218,7 @@ static bool audioout_convert_s16m_u8s(
218218

219219
bool buffer_changed = false;
220220
if (in_buffer_size > *out_buffer_size) {
221-
*out_buffer = m_malloc(in_buffer_size);
221+
*out_buffer = m_malloc_without_collect(in_buffer_size);
222222
buffer_changed = true;
223223
}
224224
audiosample_convert_s16m_u8s(*out_buffer, (int16_t *)in_buffer, in_buffer_size / 2);
@@ -250,7 +250,7 @@ static bool audioout_convert_s16s_u8s(
250250

251251
bool buffer_changed = false;
252252
if (in_buffer_size / 2 > *out_buffer_size) {
253-
*out_buffer = m_malloc(in_buffer_size / 2);
253+
*out_buffer = m_malloc_without_collect(in_buffer_size / 2);
254254
buffer_changed = true;
255255
}
256256
audiosample_convert_s16s_u8s(*out_buffer, (int16_t *)in_buffer, in_buffer_size / 4);

ports/espressif/common-hal/nvm/ByteArray.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static esp_err_t get_bytes(nvs_handle_t handle, uint8_t **buf_out) {
4646
*buf_out = NULL;
4747
return result;
4848
}
49-
buf = m_malloc(size); // this SHOULD be the same as
49+
buf = m_malloc_without_collect(size); // this SHOULD be the same as
5050
if (result == ESP_OK) {
5151
result = nvs_get_blob(handle, "data", buf, &size);
5252
} else {

ports/espressif/common-hal/pulseio/PulseIn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ static bool _done_callback(rmt_channel_handle_t rx_chan,
7474

7575
void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, const mcu_pin_obj_t *pin,
7676
uint16_t maxlen, bool idle_state) {
77-
self->buffer = (uint16_t *)m_malloc(maxlen * sizeof(uint16_t));
77+
self->buffer = (uint16_t *)m_malloc_without_collect(maxlen * sizeof(uint16_t));
7878
if (self->buffer == NULL) {
7979
m_malloc_fail(maxlen * sizeof(uint16_t));
8080
}
8181
// We add one to the maxlen version to ensure that two symbols at lease are
8282
// captured because we may skip the first portion of a symbol.
8383
self->raw_symbols_size = MIN(64, maxlen / 2 + 1) * sizeof(rmt_symbol_word_t);
84-
self->raw_symbols = (rmt_symbol_word_t *)m_malloc(self->raw_symbols_size);
84+
self->raw_symbols = (rmt_symbol_word_t *)m_malloc_without_collect(self->raw_symbols_size);
8585
if (self->raw_symbols == NULL) {
8686
m_free(self->buffer);
8787
m_malloc_fail(self->raw_symbols_size);

ports/espressif/mpconfigport.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
#define MICROPY_NLR_SETJMP (1)
2323
#define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000
2424

25+
// PSRAM can require more stack space for GC.
26+
#define MICROPY_ALLOC_GC_STACK_SIZE (128)
27+
2528
// Nearly all boards have this because it is used to enter the ROM bootloader.
2629
#ifndef CIRCUITPY_BOOT_BUTTON
2730
#if defined(CONFIG_IDF_TARGET_ESP32C2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32H2)

ports/mimxrt10xx/common-hal/audiobusio/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ void port_i2s_initialize(i2s_t *self, int instance, sai_transceiver_t *config) {
309309
mp_raise_ValueError_varg(MP_ERROR_TEXT("Invalid %q"), MP_QSTR_I2SOut);
310310
}
311311
for (size_t i = 0; i < MP_ARRAY_SIZE(self->buffers); i++) {
312-
self->buffers[i] = m_malloc(AUDIO_BUFFER_FRAME_COUNT * sizeof(uint32_t));
312+
self->buffers[i] = m_malloc_without_collect(AUDIO_BUFFER_FRAME_COUNT * sizeof(uint32_t));
313313
}
314314
self->peripheral = peripheral;
315315
SAI_Init(self->peripheral);

ports/mimxrt10xx/common-hal/canio/CAN.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, const mcu_pin_obj_t *
228228
self->silent = silent;
229229
self->baudrate = baudrate;
230230

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

ports/mimxrt10xx/common-hal/canio/Listener.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,13 @@ mp_obj_t common_hal_canio_listener_receive(canio_listener_obj_t *self) {
123123
// allows the CPU to serve the next FIFO entry
124124
FLEXCAN_ClearMbStatusFlags(self->can->data->base, (uint32_t)kFLEXCAN_RxFifoFrameAvlFlag);
125125

126-
canio_message_obj_t *message = m_new_obj(canio_message_obj_t);
126+
const mp_obj_type_t *type;
127+
if (rx_frame.type == kFLEXCAN_FrameTypeRemote) {
128+
type = &canio_remote_transmission_request_type;
129+
} else {
130+
type = &canio_message_type;
131+
}
132+
canio_message_obj_t *message = mp_obj_malloc(canio_message_obj_t, type);
127133
memset(message, 0, sizeof(canio_message_obj_t));
128134

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

137-
if (rx_frame.type == kFLEXCAN_FrameTypeRemote) {
138-
message->base.type = &canio_remote_transmission_request_type;
139-
} else {
140-
message->base.type = &canio_message_type;
141-
}
142143

143144
message->size = rx_frame.length;
144145

ports/nordic/common-hal/_bleio/Adapter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t
524524
}
525525
self->scan_results = shared_module_bleio_new_scanresults(buffer_size, prefixes, prefix_length, minimum_rssi);
526526
size_t max_packet_size = extended ? BLE_GAP_SCAN_BUFFER_EXTENDED_MAX_SUPPORTED : BLE_GAP_SCAN_BUFFER_MAX;
527-
uint8_t *raw_data = m_malloc(sizeof(ble_data_t) + max_packet_size);
527+
uint8_t *raw_data = m_malloc_without_collect(sizeof(ble_data_t) + max_packet_size);
528528
ble_data_t *sd_data = (ble_data_t *)raw_data;
529529
self->scan_results->common_hal_data = sd_data;
530530
sd_data->len = max_packet_size;

0 commit comments

Comments
 (0)