diff options
| author | Damien George | 2014-03-26 22:46:03 +0000 |
|---|---|---|
| committer | Damien George | 2014-03-26 22:46:03 +0000 |
| commit | eed6f26bed82969e3c9954159b17fe2733f4cb42 (patch) | |
| tree | 204b135703111e810149f8f9fd0c786cc57c45ab /stmhal/dac.c | |
| parent | f61a072f68c59a7acf560e2ead948fb7658c523d (diff) | |
stmhal: Use rt_check_nargs to check number of arguments.
Diffstat (limited to 'stmhal/dac.c')
| -rw-r--r-- | stmhal/dac.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/stmhal/dac.c b/stmhal/dac.c index caf8beeec..8bbab35be 100644 --- a/stmhal/dac.c +++ b/stmhal/dac.c @@ -65,9 +65,7 @@ STATIC pyb_dac_obj_t pyb_dac_channel_2 = {{&pyb_dac_type}, DAC_CHANNEL_2, DMA1_S STATIC mp_obj_t pyb_dac_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, "Dac accepts 1 argument")); - } + rt_check_nargs(n_args, 1, 1, n_kw, false); machine_int_t dac_id = mp_obj_get_int(args[0]); uint32_t pin; |
