Correct call structure for throwing errors
This commit is contained in:
parent
71c4f100de
commit
f7c7904e2b
@ -144,16 +144,16 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t* self,
|
||||
}
|
||||
#endif
|
||||
if (bc_clock_unit == 0xff) {
|
||||
mp_raise_ValueError_varg(translate("Invalid %q pin", MP_QSTR_bit_clock));
|
||||
mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_bit_clock);
|
||||
}
|
||||
if (ws_clock_unit == 0xff) {
|
||||
mp_raise_ValueError_varg(translate("Invalid %q pin", MP_QSTR_word_select));
|
||||
mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_word_select);
|
||||
}
|
||||
if (bc_clock_unit != ws_clock_unit) {
|
||||
mp_raise_ValueError(translate("Bit clock and word select must share a clock unit"));
|
||||
}
|
||||
if (serializer == 0xff) {
|
||||
mp_raise_ValueError_varg(translate("Invalid %q pin", MP_QSTR_data));
|
||||
mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_data);
|
||||
}
|
||||
self->clock_unit = ws_clock_unit;
|
||||
self->serializer = serializer;
|
||||
|
@ -106,7 +106,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self,
|
||||
self->clock_unit = 1;
|
||||
#endif
|
||||
} else {
|
||||
mp_raise_ValueError_varg(translate("Invalid %q pin", MP_QSTR_clock));
|
||||
mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_clock);
|
||||
}
|
||||
|
||||
self->data_pin = data_pin; // PA07, PA19 -> SD0, PA08, PB16 -> SD1
|
||||
@ -127,7 +127,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self,
|
||||
self->serializer = 1;
|
||||
#endif
|
||||
} else {
|
||||
mp_raise_ValueError_varg(translate("Invalid %q pin", MP_QSTR_data));
|
||||
mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_data);
|
||||
}
|
||||
|
||||
if (!(bit_depth == 16 || bit_depth == 8) || !mono || oversample != OVERSAMPLING) {
|
||||
|
Loading…
Reference in New Issue
Block a user