diff options
author | Daniel Campora <daniel@wipy.io> | 2015-09-27 09:28:27 +0200 |
---|---|---|
committer | Daniel Campora <daniel@wipy.io> | 2015-09-27 09:28:27 +0200 |
commit | a7261ae059f171e9677a86c59c7f7ed9e24b7ace (patch) | |
tree | cb2e8444c5a24a0c42361c848cb62b3000c09f4c /cc3200/mods/pybsd.c | |
parent | 635ef164327f29c4f682c6234e3b6fe6c078e480 (diff) | |
download | micropython-a7261ae059f171e9677a86c59c7f7ed9e24b7ace.tar.gz micropython-a7261ae059f171e9677a86c59c7f7ed9e24b7ace.zip |
cc3200/mods: Use mp_obj_get_array_fixed_n() where applicable.
Diffstat (limited to 'cc3200/mods/pybsd.c')
-rw-r--r-- | cc3200/mods/pybsd.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/cc3200/mods/pybsd.c b/cc3200/mods/pybsd.c index 55dc98ae80..04125ef69f 100644 --- a/cc3200/mods/pybsd.c +++ b/cc3200/mods/pybsd.c @@ -95,17 +95,13 @@ STATIC mp_obj_t pyb_sd_init_helper (pybsd_obj_t *self, const mp_arg_val_t *args) mp_obj_t pins_o = args[0].u_obj; if (pins_o != mp_const_none) { mp_obj_t *pins; - mp_uint_t n_pins = MP_ARRAY_SIZE(pyb_sd_def_pin); if (pins_o == MP_OBJ_NULL) { // use the default pins pins = (mp_obj_t *)pyb_sd_def_pin; } else { - mp_obj_get_array(pins_o, &n_pins, &pins); - if (n_pins != MP_ARRAY_SIZE(pyb_sd_def_pin)) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, mpexception_value_invalid_arguments)); - } + mp_obj_get_array_fixed_n(pins_o, MP_ARRAY_SIZE(pyb_sd_def_pin), &pins); } - pin_assign_pins_af (pins, n_pins, PIN_TYPE_STD_PU, PIN_FN_SD, 0); + pin_assign_pins_af (pins, MP_ARRAY_SIZE(pyb_sd_def_pin), PIN_TYPE_STD_PU, PIN_FN_SD, 0); // save the pins clock self->pin_clk = pin_find(pins[0]); } |