Skip to content

Commit e00a702

Browse files
committed
Stop DHCP when configuring IP address #1800
1 parent 832f07a commit e00a702

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

shared-bindings/wiznet/wiznet5k.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ STATIC mp_obj_t wiznet5k_make_new(const mp_obj_type_t *type, size_t n_args, cons
7777
};
7878
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
7979
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
80-
// XXX check type of ARG_spi?
80+
// TODO check type of ARG_spi?
8181
assert_pin(args[ARG_cs].u_obj, false);
8282
assert_pin(args[ARG_rst].u_obj, true); // may be NULL
8383

@@ -144,6 +144,7 @@ const mp_obj_property_t wiznet5k_dhcp_obj = {
144144
//| (ip_address, subnet_mask, gateway_address, dns_server)
145145
//|
146146
//| Or can be called with the same tuple to set those parameters.
147+
//| Setting ifconfig parameters turns DHCP off, if it was on.
147148
//|
148149

149150
STATIC mp_obj_t wiznet5k_ifconfig(size_t n_args, const mp_obj_t *args) {
@@ -160,7 +161,7 @@ STATIC mp_obj_t wiznet5k_ifconfig(size_t n_args, const mp_obj_t *args) {
160161
return mp_obj_new_tuple(4, tuple);
161162
} else {
162163
// set
163-
// XXX should this automatically stop DHCP here?
164+
wiznet5k_stop_dhcp();
164165
mp_obj_t *items;
165166
mp_obj_get_array_fixed_n(args[1], 4, &items);
166167
netutils_parse_ipv4_addr(items[0], netinfo.ip, NETUTILS_BIG);

0 commit comments

Comments
 (0)