diff options
| author | Nick Moore <nick@zoic.org> | 2019-05-07 18:41:53 +1000 |
|---|---|---|
| committer | Nick Moore <nick@zoic.org> | 2019-05-07 18:41:53 +1000 |
| commit | 264fc2b07041a55aaf607c1839914acf056b1513 (patch) | |
| tree | 3ffe5b1e0dcdc797dc5e5e2a1a1f36945dc603b0 /shared-bindings/wiznet | |
| parent | 24934a1e8abbe51809c47b94fa5657d21ac783fb (diff) | |
Make wiznet5k RST pin optional adafruit/circuitpython#1800
Diffstat (limited to 'shared-bindings/wiznet')
| -rw-r--r-- | shared-bindings/wiznet/wiznet5k.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/shared-bindings/wiznet/wiznet5k.c b/shared-bindings/wiznet/wiznet5k.c index 826783771..b8382162f 100644 --- a/shared-bindings/wiznet/wiznet5k.c +++ b/shared-bindings/wiznet/wiznet5k.c @@ -66,15 +66,14 @@ STATIC mp_obj_t wiznet5k_make_new(const mp_obj_type_t *type, size_t n_args, cons static const mp_arg_t allowed_args[] = { { MP_QSTR_spi, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_cs, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_rst, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_rst, MP_ARG_OBJ, { .u_obj = mp_const_none } }, { MP_QSTR_dhcp, MP_ARG_KW_ONLY | MP_ARG_BOOL, { .u_bool = true } }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); // XXX check type of ARG_spi? - // XXX should ARG_rst be optional? assert_pin(args[ARG_cs].u_obj, false); - assert_pin(args[ARG_rst].u_obj, false); + assert_pin(args[ARG_rst].u_obj, true); // may be NULL mp_obj_t ret = wiznet5k_create(args[ARG_spi].u_obj, args[ARG_cs].u_obj, args[ARG_rst].u_obj); if (args[ARG_dhcp].u_bool) wiznet5k_start_dhcp(); |
