From f7c7904e2b717e5167736db18c0b3de5e58d8bdf Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 17 Apr 2019 13:54:29 -0700 Subject: [PATCH] Correct call structure for throwing errors --- ports/atmel-samd/common-hal/audiobusio/I2SOut.c | 6 +++--- ports/atmel-samd/common-hal/audiobusio/PDMIn.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c index 3ca089a70d..20934bed4f 100644 --- a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c +++ b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -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; diff --git a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c index f583f31a32..8b308b60b0 100644 --- a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c +++ b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -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) {