summaryrefslogtreecommitdiff
path: root/stmhal/led.c
diff options
context:
space:
mode:
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 13dc81d18..557f54538 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;