summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/led.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-03-26 22:46:03 +0000
committerDamien George <damien.p.george@gmail.com>2014-03-26 22:46:03 +0000
commiteed6f26bed82969e3c9954159b17fe2733f4cb42 (patch)
tree204b135703111e810149f8f9fd0c786cc57c45ab /stmhal/led.c
parentf61a072f68c59a7acf560e2ead948fb7658c523d (diff)
downloadmicropython-eed6f26bed82969e3c9954159b17fe2733f4cb42.tar.gz
micropython-eed6f26bed82969e3c9954159b17fe2733f4cb42.zip
stmhal: Use rt_check_nargs to check number of arguments.
Diffstat (limited to 'stmhal/led.c')
-rw-r--r--stmhal/led.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/stmhal/led.c b/stmhal/led.c
index 13dc81d18e..557f54538e 100644
--- a/stmhal/led.c
+++ b/stmhal/led.c
@@ -208,9 +208,7 @@ void led_obj_print(void (*print)(void *env, const char *fmt, ...), void *env, mp
STATIC mp_obj_t led_obj_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, "Led accepts 1 argument"));
- }
+ rt_check_nargs(n_args, 1, 1, n_kw, false);
// get led number
machine_int_t led_id = mp_obj_get_int(args[0]) - 1;