Open GoogleCodeExporter opened 9 years ago
This also occours on arduino 1.0.1 under windows XP, I have a sketch 29Kbyt
that uses both Ethernet.h and EthernetUdp.h that throws up INADDR_NONE 8 times.
This uses up a lot of SRAM especially when your trying to improve the sketch so
it does not crash because variables run into the stack!
Original comment by brucedur...@btinternet.com
on 26 Feb 2013 at 8:24
I believe that I've found another solution to this!!
INADDR_NONE is only used by Dns.cpp so why is it declared as a const at the end
if IPAddress.h as though its an afterthought??
My solution is to doctor both IPAddress.h (which is in
x:\..\arduino-1.0.1\hardware\arduino\cores\arduino) to remark out the line
'const IPAddress INADDR_NONE(0,0,0,0);' and to add this line to the Dns.cpp
(which is in x:\..\arduino-1.0.1\libraries\Ethernet) just above where it is
used in
'// Check we've got a valid DNS server to use
const IPAddress INADDR_NONE(0,0,0,0); // These probably a more elegant way to do this but it works
if (iDNSServer == INADDR_NONE)
{
return INVALID_SERVER;
}'
Which is on lines 129-131.
This gives me back 48bytes of SRAM and incidentally makes the Sketch 200 odd
bytes smaller!
Original comment by brucedur...@btinternet.com
on 7 Mar 2013 at 4:56
It does of course not matter whereto you more the definition, but if the
declaration is in IPAddress.h then one would normally expect the definition in
IPAddress.cpp.
Original comment by sebastia...@googlemail.com
on 9 Mar 2013 at 8:22
Original issue reported on code.google.com by
sebastia...@googlemail.com
on 16 Aug 2012 at 6:20