Skip to content

Commit e07d201

Browse files
committed
Update dhcp.c
add unlock sequence when use setSHAR for w6100
1 parent 771478a commit e07d201

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

Internet/DHCP/dhcp.c

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,13 @@ void default_ip_update(void)
281281
getMR(); // for delay
282282
#endif
283283
default_ip_assign();
284-
setSHAR(DHCP_CHADDR);
284+
#if _WIZCHIP_ == W6100
285+
NETUNLOCK();
286+
setSHAR(DHCP_CHADDR);
287+
NETLOCK();
288+
#else
289+
setSHAR(DHCP_CHADDR);
290+
#endif
285291
}
286292

287293
/* The default handler of ip changed */
@@ -304,7 +310,13 @@ void default_ip_conflict(void)
304310
setMR(MR_RST);
305311
getMR(); // for delay
306312
#endif
313+
#if _WIZCHIP_ == W6100
314+
NETUNLOCK();
315+
setSHAR(DHCP_CHADDR);
316+
NETLOCK();
317+
#else
307318
setSHAR(DHCP_CHADDR);
319+
#endif
308320
}
309321

310322
/* register the call back func. */
@@ -1016,7 +1028,13 @@ void DHCP_init(uint8_t s, uint8_t * buf)
10161028
DHCP_CHADDR[3] = 0x00;
10171029
DHCP_CHADDR[4] = 0x00;
10181030
DHCP_CHADDR[5] = 0x00;
1019-
setSHAR(DHCP_CHADDR);
1031+
#if _WIZCHIP_ == W6100
1032+
NETUNLOCK();
1033+
setSHAR(DHCP_CHADDR);
1034+
NETLOCK();
1035+
#else
1036+
setSHAR(DHCP_CHADDR);
1037+
#endif
10201038
}
10211039

10221040
DHCP_SOCKET = s; // SOCK_DHCP

0 commit comments

Comments
 (0)