Skip to content

Commit 5e204c9

Browse files
authored
Merge branch 'main' into mp3decoder-reopen-glitch
2 parents 22abf2d + 2bb9fc4 commit 5e204c9

File tree

7 files changed

+60
-95
lines changed

7 files changed

+60
-95
lines changed

locale/en_GB.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: PACKAGE VERSION\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"PO-Revision-Date: 2024-11-14 12:00+0000\n"
10+
"PO-Revision-Date: 2024-12-04 13:00+0000\n"
1111
"Last-Translator: Andi Chandler <[email protected]>\n"
1212
"Language-Team: none\n"
1313
"Language: en_GB\n"
@@ -2535,7 +2535,7 @@ msgstr "binary op %q not implemented"
25352535

25362536
#: ports/espressif/common-hal/audiobusio/PDMIn.c
25372537
msgid "bit_depth must be 8, 16, 24, or 32."
2538-
msgstr ""
2538+
msgstr "bit_depth must be 8, 16, 24, or 32."
25392539

25402540
#: shared-module/bitmapfilter/__init__.c
25412541
msgid "bitmap size and depth must match"

locale/pt_BR.po

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ msgstr ""
66
"Project-Id-Version: PACKAGE VERSION\n"
77
"Report-Msgid-Bugs-To: \n"
88
"POT-Creation-Date: 2021-01-04 12:55-0600\n"
9-
"PO-Revision-Date: 2024-11-11 07:05+0000\n"
9+
"PO-Revision-Date: 2024-12-04 19:57+0000\n"
1010
"Last-Translator: Wellington Terumi Uemura <[email protected]>\n"
1111
"Language-Team: \n"
1212
"Language: pt_BR\n"
1313
"MIME-Version: 1.0\n"
1414
"Content-Type: text/plain; charset=UTF-8\n"
1515
"Content-Transfer-Encoding: 8bit\n"
1616
"Plural-Forms: nplurals=2; plural=n > 1;\n"
17-
"X-Generator: Weblate 5.8.2\n"
17+
"X-Generator: Weblate 5.9-dev\n"
1818

1919
#: main.c
2020
msgid ""
@@ -2571,7 +2571,7 @@ msgstr "a operação binário %q não foi implementada"
25712571

25722572
#: ports/espressif/common-hal/audiobusio/PDMIn.c
25732573
msgid "bit_depth must be 8, 16, 24, or 32."
2574-
msgstr ""
2574+
msgstr "o bit_depth deve ser 8, 16, 24 ou 32."
25752575

25762576
#: shared-module/bitmapfilter/__init__.c
25772577
msgid "bitmap size and depth must match"

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,13 @@ CIRCUITPY_GIFIO = 0
1616
CIRCUITPY_JPEGIO = 0
1717

1818
CIRCUITPY_BITBANG_APA102 = 1
19+
20+
# We don't have room for the fonts for terminalio for certain languages,
21+
# so turn off terminalio, and if it's off and displayio is on,
22+
# force a clean build.
23+
# Note that we cannot test $(CIRCUITPY_DISPLAYIO) directly with an
24+
# ifeq, because it's not set yet.
25+
ifneq (,$(filter $(TRANSLATION),ja ko ru))
26+
CIRCUITPY_TERMINALIO = 0
27+
RELEASE_NEEDS_CLEAN_BUILD = $(CIRCUITPY_DISPLAYIO)
28+
endif

shared-bindings/audiodelays/Echo.c

Lines changed: 16 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -153,20 +153,12 @@ static mp_obj_t audiodelays_echo_obj_get_delay_ms(mp_obj_t self_in) {
153153
}
154154
MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_echo_get_delay_ms_obj, audiodelays_echo_obj_get_delay_ms);
155155

156-
static mp_obj_t audiodelays_echo_obj_set_delay_ms(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
157-
enum { ARG_delay_ms };
158-
static const mp_arg_t allowed_args[] = {
159-
{ MP_QSTR_delay_ms, MP_ARG_OBJ | MP_ARG_REQUIRED, {} },
160-
};
161-
audiodelays_echo_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
162-
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
163-
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
164-
165-
common_hal_audiodelays_echo_set_delay_ms(self, args[ARG_delay_ms].u_obj);
166-
156+
static mp_obj_t audiodelays_echo_obj_set_delay_ms(mp_obj_t self_in, mp_obj_t delay_ms_in) {
157+
audiodelays_echo_obj_t *self = MP_OBJ_TO_PTR(self_in);
158+
common_hal_audiodelays_echo_set_delay_ms(self, delay_ms_in);
167159
return mp_const_none;
168160
}
169-
MP_DEFINE_CONST_FUN_OBJ_KW(audiodelays_echo_set_delay_ms_obj, 1, audiodelays_echo_obj_set_delay_ms);
161+
MP_DEFINE_CONST_FUN_OBJ_2(audiodelays_echo_set_delay_ms_obj, audiodelays_echo_obj_set_delay_ms);
170162

171163
MP_PROPERTY_GETSET(audiodelays_echo_delay_ms_obj,
172164
(mp_obj_t)&audiodelays_echo_get_delay_ms_obj,
@@ -179,20 +171,12 @@ static mp_obj_t audiodelays_echo_obj_get_decay(mp_obj_t self_in) {
179171
}
180172
MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_echo_get_decay_obj, audiodelays_echo_obj_get_decay);
181173

182-
static mp_obj_t audiodelays_echo_obj_set_decay(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
183-
enum { ARG_decay };
184-
static const mp_arg_t allowed_args[] = {
185-
{ MP_QSTR_decay, MP_ARG_OBJ | MP_ARG_REQUIRED, {} },
186-
};
187-
audiodelays_echo_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
188-
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
189-
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
190-
191-
common_hal_audiodelays_echo_set_decay(self, args[ARG_decay].u_obj);
192-
174+
static mp_obj_t audiodelays_echo_obj_set_decay(mp_obj_t self_in, mp_obj_t decay_in) {
175+
audiodelays_echo_obj_t *self = MP_OBJ_TO_PTR(self_in);
176+
common_hal_audiodelays_echo_set_decay(self, decay_in);
193177
return mp_const_none;
194178
}
195-
MP_DEFINE_CONST_FUN_OBJ_KW(audiodelays_echo_set_decay_obj, 1, audiodelays_echo_obj_set_decay);
179+
MP_DEFINE_CONST_FUN_OBJ_2(audiodelays_echo_set_decay_obj, audiodelays_echo_obj_set_decay);
196180

197181
MP_PROPERTY_GETSET(audiodelays_echo_decay_obj,
198182
(mp_obj_t)&audiodelays_echo_get_decay_obj,
@@ -205,20 +189,12 @@ static mp_obj_t audiodelays_echo_obj_get_mix(mp_obj_t self_in) {
205189
}
206190
MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_echo_get_mix_obj, audiodelays_echo_obj_get_mix);
207191

208-
static mp_obj_t audiodelays_echo_obj_set_mix(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
209-
enum { ARG_mix };
210-
static const mp_arg_t allowed_args[] = {
211-
{ MP_QSTR_mix, MP_ARG_OBJ | MP_ARG_REQUIRED, {} },
212-
};
213-
audiodelays_echo_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
214-
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
215-
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
216-
217-
common_hal_audiodelays_echo_set_mix(self, args[ARG_mix].u_obj);
218-
192+
static mp_obj_t audiodelays_echo_obj_set_mix(mp_obj_t self_in, mp_obj_t mix_in) {
193+
audiodelays_echo_obj_t *self = MP_OBJ_TO_PTR(self_in);
194+
common_hal_audiodelays_echo_set_mix(self, mix_in);
219195
return mp_const_none;
220196
}
221-
MP_DEFINE_CONST_FUN_OBJ_KW(audiodelays_echo_set_mix_obj, 1, audiodelays_echo_obj_set_mix);
197+
MP_DEFINE_CONST_FUN_OBJ_2(audiodelays_echo_set_mix_obj, audiodelays_echo_obj_set_mix);
222198

223199
MP_PROPERTY_GETSET(audiodelays_echo_mix_obj,
224200
(mp_obj_t)&audiodelays_echo_get_mix_obj,
@@ -233,20 +209,12 @@ static mp_obj_t audiodelays_echo_obj_get_freq_shift(mp_obj_t self_in) {
233209
}
234210
MP_DEFINE_CONST_FUN_OBJ_1(audiodelays_echo_get_freq_shift_obj, audiodelays_echo_obj_get_freq_shift);
235211

236-
static mp_obj_t audiodelays_echo_obj_set_freq_shift(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
237-
enum { ARG_freq_shift };
238-
static const mp_arg_t allowed_args[] = {
239-
{ MP_QSTR_freq_shift, MP_ARG_BOOL | MP_ARG_REQUIRED, {} },
240-
};
241-
audiodelays_echo_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
242-
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
243-
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
244-
245-
common_hal_audiodelays_echo_set_freq_shift(self, args[ARG_freq_shift].u_bool);
246-
212+
static mp_obj_t audiodelays_echo_obj_set_freq_shift(mp_obj_t self_in, mp_obj_t freq_shift_in) {
213+
audiodelays_echo_obj_t *self = MP_OBJ_TO_PTR(self_in);
214+
common_hal_audiodelays_echo_set_freq_shift(self, mp_obj_is_true(freq_shift_in));
247215
return mp_const_none;
248216
}
249-
MP_DEFINE_CONST_FUN_OBJ_KW(audiodelays_echo_set_freq_shift_obj, 1, audiodelays_echo_obj_set_freq_shift);
217+
MP_DEFINE_CONST_FUN_OBJ_2(audiodelays_echo_set_freq_shift_obj, audiodelays_echo_obj_set_freq_shift);
250218

251219
MP_PROPERTY_GETSET(audiodelays_echo_freq_shift_obj,
252220
(mp_obj_t)&audiodelays_echo_get_freq_shift_obj,

shared-bindings/audiofilters/Filter.c

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -139,20 +139,12 @@ static mp_obj_t audiofilters_filter_obj_get_filter(mp_obj_t self_in) {
139139
}
140140
MP_DEFINE_CONST_FUN_OBJ_1(audiofilters_filter_get_filter_obj, audiofilters_filter_obj_get_filter);
141141

142-
static mp_obj_t audiofilters_filter_obj_set_filter(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
143-
enum { ARG_filter };
144-
static const mp_arg_t allowed_args[] = {
145-
{ MP_QSTR_filter, MP_ARG_OBJ | MP_ARG_REQUIRED, {} },
146-
};
147-
audiofilters_filter_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
148-
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
149-
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
150-
151-
common_hal_audiofilters_filter_set_filter(self, args[ARG_filter].u_obj);
152-
142+
static mp_obj_t audiofilters_filter_obj_set_filter(mp_obj_t self_in, mp_obj_t filter_in) {
143+
audiofilters_filter_obj_t *self = MP_OBJ_TO_PTR(self_in);
144+
common_hal_audiofilters_filter_set_filter(self, filter_in);
153145
return mp_const_none;
154146
}
155-
MP_DEFINE_CONST_FUN_OBJ_KW(audiofilters_filter_set_filter_obj, 1, audiofilters_filter_obj_set_filter);
147+
MP_DEFINE_CONST_FUN_OBJ_2(audiofilters_filter_set_filter_obj, audiofilters_filter_obj_set_filter);
156148

157149
MP_PROPERTY_GETSET(audiofilters_filter_filter_obj,
158150
(mp_obj_t)&audiofilters_filter_get_filter_obj,
@@ -166,20 +158,12 @@ static mp_obj_t audiofilters_filter_obj_get_mix(mp_obj_t self_in) {
166158
}
167159
MP_DEFINE_CONST_FUN_OBJ_1(audiofilters_filter_get_mix_obj, audiofilters_filter_obj_get_mix);
168160

169-
static mp_obj_t audiofilters_filter_obj_set_mix(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
170-
enum { ARG_mix };
171-
static const mp_arg_t allowed_args[] = {
172-
{ MP_QSTR_mix, MP_ARG_OBJ | MP_ARG_REQUIRED, {} },
173-
};
174-
audiofilters_filter_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
175-
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
176-
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
177-
178-
common_hal_audiofilters_filter_set_mix(self, args[ARG_mix].u_obj);
179-
161+
static mp_obj_t audiofilters_filter_obj_set_mix(mp_obj_t self_in, mp_obj_t mix_in) {
162+
audiofilters_filter_obj_t *self = MP_OBJ_TO_PTR(self_in);
163+
common_hal_audiofilters_filter_set_mix(self, mix_in);
180164
return mp_const_none;
181165
}
182-
MP_DEFINE_CONST_FUN_OBJ_KW(audiofilters_filter_set_mix_obj, 1, audiofilters_filter_obj_set_mix);
166+
MP_DEFINE_CONST_FUN_OBJ_2(audiofilters_filter_set_mix_obj, audiofilters_filter_obj_set_mix);
183167

184168
MP_PROPERTY_GETSET(audiofilters_filter_mix_obj,
185169
(mp_obj_t)&audiofilters_filter_get_mix_obj,

shared-bindings/audiomixer/MixerVoice.c

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -82,26 +82,13 @@ static mp_obj_t audiomixer_mixervoice_obj_get_level(mp_obj_t self_in) {
8282
}
8383
MP_DEFINE_CONST_FUN_OBJ_1(audiomixer_mixervoice_get_level_obj, audiomixer_mixervoice_obj_get_level);
8484

85-
static mp_obj_t audiomixer_mixervoice_obj_set_level(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
86-
enum { ARG_level };
87-
static const mp_arg_t allowed_args[] = {
88-
{ MP_QSTR_level, MP_ARG_OBJ | MP_ARG_REQUIRED, {} },
89-
};
90-
audiomixer_mixervoice_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
91-
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
92-
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
93-
94-
mp_float_t level = mp_obj_get_float(args[ARG_level].u_obj);
95-
96-
if (level > 1 || level < 0) {
97-
mp_raise_ValueError(MP_ERROR_TEXT("level must be between 0 and 1"));
98-
}
99-
85+
static mp_obj_t audiomixer_mixervoice_obj_set_level(mp_obj_t self_in, mp_obj_t level_in) {
86+
audiomixer_mixervoice_obj_t *self = MP_OBJ_TO_PTR(self_in);
87+
mp_float_t level = mp_arg_validate_obj_float_range(level_in, 0, 1, MP_QSTR_level);
10088
common_hal_audiomixer_mixervoice_set_level(self, level);
101-
10289
return mp_const_none;
10390
}
104-
MP_DEFINE_CONST_FUN_OBJ_KW(audiomixer_mixervoice_set_level_obj, 1, audiomixer_mixervoice_obj_set_level);
91+
MP_DEFINE_CONST_FUN_OBJ_2(audiomixer_mixervoice_set_level_obj, audiomixer_mixervoice_obj_set_level);
10592

10693
MP_PROPERTY_GETSET(audiomixer_mixervoice_level_obj,
10794
(mp_obj_t)&audiomixer_mixervoice_get_level_obj,

shared-bindings/rgbmatrix/RGBMatrix.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,16 @@ static void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_
116116
#endif
117117
}
118118

119+
typedef struct {
120+
nlr_jump_callback_node_t callback;
121+
mp_obj_base_t *base_ptr;
122+
} nlr_jump_callback_node_clear_displaybus_t;
123+
124+
static void clear_display_bus(void *node_in) {
125+
nlr_jump_callback_node_clear_displaybus_t *node = node_in;
126+
node->base_ptr->type = &mp_type_NoneType;
127+
}
128+
119129
//| def __init__(
120130
//| self,
121131
//| *,
@@ -217,6 +227,13 @@ static mp_obj_t rgbmatrix_rgbmatrix_make_new(const mp_obj_type_t *type, size_t n
217227
rgbmatrix_rgbmatrix_obj_t *self = &allocate_display_bus_or_raise()->rgbmatrix;
218228
self->base.type = &rgbmatrix_RGBMatrix_type;
219229

230+
// If an exception is thrown, ensure the display bus object's type is set
231+
// back to the uninitialized/deinitialied type. **note that all other resource
232+
// deallocations must be handled by the shared-module code**
233+
nlr_jump_callback_node_clear_displaybus_t node;
234+
node.base_ptr = &self->base;
235+
nlr_push_jump_callback(&node.callback, clear_display_bus);
236+
220237
uint8_t rgb_count, addr_count;
221238
uint8_t rgb_pins[MP_ARRAY_SIZE(self->rgb_pins)];
222239
uint8_t addr_pins[MP_ARRAY_SIZE(self->addr_pins)];
@@ -254,7 +271,6 @@ static mp_obj_t rgbmatrix_rgbmatrix_make_new(const mp_obj_type_t *type, size_t n
254271
clock_pin, latch_pin, output_enable_pin,
255272
args[ARG_doublebuffer].u_bool,
256273
args[ARG_framebuffer].u_obj, tile, args[ARG_serpentine].u_bool, NULL);
257-
258274
claim_and_never_reset_pins(args[ARG_rgb_list].u_obj);
259275
claim_and_never_reset_pins(args[ARG_addr_list].u_obj);
260276
claim_and_never_reset_pin(args[ARG_clock_pin].u_obj);

0 commit comments

Comments
 (0)