diff options
Diffstat (limited to 'stmhal/i2c.c')
-rw-r--r-- | stmhal/i2c.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/stmhal/i2c.c b/stmhal/i2c.c index 9bf7799f40..9556e32c9c 100644 --- a/stmhal/i2c.c +++ b/stmhal/i2c.c @@ -80,9 +80,7 @@ STATIC pyb_i2c_obj_t pyb_i2c_obj[PYB_NUM_I2C] = {{{&pyb_i2c_type}, &I2cHandle_X} STATIC mp_obj_t pyb_i2c_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { // check arguments - if (!(n_args == 1 && n_kw == 0)) { - nlr_jump(mp_obj_new_exception_msg(&mp_type_ValueError, "I2C accepts 1 argument")); - } + rt_check_nargs(n_args, 1, 1, n_kw, false); // get i2c number machine_int_t i2c_id = mp_obj_get_int(args[0]) - 1; |