Skip to content

Commit 3539814

Browse files
committed
moves static declaration out of method
because of a known bug, the declaration of DhcpClass has to be outside the EthernetClass::begin(*mac) Method. Only if it is used with DHCP this error occurs. More details: esp8266/Arduino#500
1 parent 4391dde commit 3539814

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Ethernet/src/Ethernet.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ uint8_t EthernetClass::_state[MAX_SOCK_NUM] = {
88
uint16_t EthernetClass::_server_port[MAX_SOCK_NUM] = {
99
0, 0, 0, 0 };
1010

11+
// moved out of method scope, because of this issue:
12+
// https://github.com/esp8266/Arduino/issues/500
13+
static DhcpClass s_dhcp;
14+
1115
int EthernetClass::begin(uint8_t *mac_address, unsigned long timeout, unsigned long responseTimeout)
1216
{
13-
static DhcpClass s_dhcp;
1417
_dhcp = &s_dhcp;
1518

1619

0 commit comments

Comments
 (0)