arduino-libraries / Ethernet

Ethernet Library for Arduino
http://arduino.cc/
259 stars 264 forks source link

DhcpAddressPrinter example: Fix initialization with no hardware present #247

Open hansu opened 10 months ago

hansu commented 10 months ago

Error message about not present Ethernet hardware was only printed if mac==0, which makes not really sense:

  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    if (Ethernet.hardwareStatus() == EthernetNoHardware) {
      Serial.println("Ethernet shield was not found.  Sorry, can't run without hardware. :(");
    }
github-actions[bot] commented 10 months ago

Memory usage change @ 064a37ded464c4fb809daf2643277db19b42e88f

Board flash % RAM for global variables %
arduino:avr:leonardo :small_red_triangle: 0 - +10 0.0 - +0.03 0 - 0 0.0 - 0.0
arduino:avr:mega :small_red_triangle: 0 - +6 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:avr:nano :small_red_triangle: 0 - +8 0.0 - +0.03 0 - 0 0.0 - 0.0
arduino:megaavr:nona4809 :small_red_triangle: 0 - +20 0.0 - +0.04 0 - 0 0.0 - 0.0
arduino:megaavr:uno2018 :small_red_triangle: 0 - +20 0.0 - +0.04 0 - 0 0.0 - 0.0
arduino:sam:arduino_due_x_dbg 0 - 0 0.0 - 0.0 N/A N/A
arduino:samd:arduino_zero_edbg :small_red_triangle: 0 - +8 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 :small_red_triangle: 0 - +4 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrfox1200 :small_red_triangle: 0 - +4 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 :small_red_triangle: 0 - +4 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 :small_red_triangle: 0 - +4 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrvidor4000 :small_red_triangle: 0 - +4 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 :small_red_triangle: 0 - +4 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1310 :small_red_triangle: 0 - +4 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 :small_red_triangle: 0 - +4 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrzero :small_red_triangle: 0 - +4 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot :small_red_triangle: 0 - +4 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table Board|`examples/AdvancedChatServer`
flash|%|`examples/AdvancedChatServer`
RAM for global variables|%|`examples/BarometricPressureWebServer`
flash|%|`examples/BarometricPressureWebServer`
RAM for global variables|%|`examples/ChatServer`
flash|%|`examples/ChatServer`
RAM for global variables|%|`examples/DhcpAddressPrinter`
flash|%|`examples/DhcpAddressPrinter`
RAM for global variables|%|`examples/DhcpChatServer`
flash|%|`examples/DhcpChatServer`
RAM for global variables|%|`examples/LinkStatus`
flash|%|`examples/LinkStatus`
RAM for global variables|%|`examples/PagerServer`
flash|%|`examples/PagerServer`
RAM for global variables|%|`examples/TelnetClient`
flash|%|`examples/TelnetClient`
RAM for global variables|%|`examples/UDPSendReceiveString`
flash|%|`examples/UDPSendReceiveString`
RAM for global variables|%|`examples/UdpNtpClient`
flash|%|`examples/UdpNtpClient`
RAM for global variables|%|`examples/WebClient`
flash|%|`examples/WebClient`
RAM for global variables|%|`examples/WebClientRepeating`
flash|%|`examples/WebClientRepeating`
RAM for global variables|%|`examples/WebServer`
flash|%|`examples/WebServer`
RAM for global variables|% -|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|- `arduino:avr:leonardo`|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|10|0.03|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.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0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0 `arduino:samd:mkrwan1310`|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|4|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0 `arduino:samd:mkrwifi1010`|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|4|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0 `arduino:samd:mkrzero`|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|4|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0 `arduino:samd:nano_33_iot`|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|4|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0
Click for full report CSV ``` Board,examples/AdvancedChatServer
flash,%,examples/AdvancedChatServer
RAM for global variables,%,examples/BarometricPressureWebServer
flash,%,examples/BarometricPressureWebServer
RAM for global variables,%,examples/ChatServer
flash,%,examples/ChatServer
RAM for global variables,%,examples/DhcpAddressPrinter
flash,%,examples/DhcpAddressPrinter
RAM for global variables,%,examples/DhcpChatServer
flash,%,examples/DhcpChatServer
RAM for global variables,%,examples/LinkStatus
flash,%,examples/LinkStatus
RAM for global variables,%,examples/PagerServer
flash,%,examples/PagerServer
RAM for global variables,%,examples/TelnetClient
flash,%,examples/TelnetClient
RAM for global variables,%,examples/UDPSendReceiveString
flash,%,examples/UDPSendReceiveString
RAM for global variables,%,examples/UdpNtpClient
flash,%,examples/UdpNtpClient
RAM for global variables,%,examples/WebClient
flash,%,examples/WebClient
RAM for global variables,%,examples/WebClientRepeating
flash,%,examples/WebClientRepeating
RAM for global variables,%,examples/WebServer
flash,%,examples/WebServer
RAM for global variables,% arduino:avr:leonardo,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,10,0.03,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0 arduino:avr:mega,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,6,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0 arduino:avr:nano,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,8,0.03,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0 arduino:megaavr:nona4809,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,20,0.04,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0 arduino:megaavr:uno2018,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,20,0.04,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0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0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0 ```
CLAassistant commented 8 months ago

CLA assistant check
All committers have signed the CLA.

hansu commented 4 months ago

Is there anything that keep this PR from being merged?