arduino-libraries / Ethernet

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

ethernetIdle() weak handler was added in order to execute some code w… #135

Open anklimov opened 4 years ago

anklimov commented 4 years ago

…hile DNS requests and TCP:open/close awaiting for results

PaulStoffregen commented 4 years ago

This should be calls to yield(), not a special new function.

anklimov commented 4 years ago

Great! it was surprise for me now, that yield() also defined as weak function. Thanks! However, definition of some ethernet library specific handler might allow to avoid re-enterability issues when ethernet functions will be invoked indirectly from yield() handler in case if some "ethernetYield" will be redefined in sketch , it will be possible to raise some global flags before normal yield() to prevent nested lib invocation. So, my suggestion to use ethernetYield() weak handler execution in loops inside lib, and to define default weak handler with normal yield(); execution inside It looks slightly more flexible.

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.

github-actions[bot] commented 3 years ago

Memory usage change @ 7cbcf56e0a2cd5e822500e4e21bf31f6b4690481

Board flash % RAM for global variables %
arduino:avr:leonardo :small_red_triangle: 0 - +36 0.0 - +0.13 0 - 0 0.0 - 0.0
arduino:avr:mega :small_red_triangle: 0 - +36 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:avr:nano :small_red_triangle: 0 - +36 0.0 - +0.12 0 - 0 0.0 - 0.0
arduino:megaavr:nona4809 :small_red_triangle: 0 - +36 0.0 - +0.07 0 - 0 0.0 - 0.0
arduino:megaavr:uno2018 :small_red_triangle: 0 - +36 0.0 - +0.07 0 - 0 0.0 - 0.0
arduino:sam:arduino_due_x_dbg :small_red_triangle: 0 - +32 0.0 - +0.01 N/A N/A
arduino:samd:arduino_zero_edbg :small_red_triangle: 0 - +32 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 :small_red_triangle: 0 - +32 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrfox1200 :small_red_triangle: 0 - +32 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 :small_red_triangle: 0 - +32 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 :small_red_triangle: 0 - +32 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrvidor4000 :small_red_triangle: 0 - +32 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 :small_red_triangle: 0 - +32 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1310 :small_red_triangle: 0 - +32 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 :small_red_triangle: 0 - +32 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrzero :small_red_triangle: 0 - +32 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot :small_red_triangle: 0 - +32 0.0 - +0.01 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/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|30|0.1|0|0.0|30|0.1|0|0.0|30|0.1|0|0.0|36|0.13|0|0.0|34|0.12|0|0.0|0|0.0|0|0.0|30|0.1|0|0.0|24|0.08|0|0.0|36|0.13|0|0.0|34|0.12|0|0.0|34|0.12|0|0.0|30|0.1|0|0.0 arduino:avr:mega|30|0.01|0|0.0|30|0.01|0|0.0|30|0.01|0|0.0|36|0.01|0|0.0|34|0.01|0|0.0|0|0.0|0|0.0|30|0.01|0|0.0|24|0.01|0|0.0|36|0.01|0|0.0|34|0.01|0|0.0|34|0.01|0|0.0|30|0.01|0|0.0 arduino:avr:nano|30|0.1|0|0.0|30|0.1|0|0.0|30|0.1|0|0.0|36|0.12|0|0.0|34|0.11|0|0.0|0|0.0|0|0.0|30|0.1|0|0.0|24|0.08|0|0.0|36|0.12|0|0.0|34|0.11|0|0.0|34|0.11|0|0.0|30|0.1|0|0.0 arduino:megaavr:nona4809|30|0.06|0|0.0|30|0.06|0|0.0|30|0.06|0|0.0|36|0.07|0|0.0|34|0.07|0|0.0|0|0.0|0|0.0|30|0.06|0|0.0|24|0.05|0|0.0|36|0.07|0|0.0|34|0.07|0|0.0|34|0.07|0|0.0|30|0.06|0|0.0 arduino:megaavr:uno2018|30|0.06|0|0.0|30|0.06|0|0.0|30|0.06|0|0.0|36|0.07|0|0.0|34|0.07|0|0.0|0|0.0|0|0.0|30|0.06|0|0.0|24|0.05|0|0.0|36|0.07|0|0.0|34|0.07|0|0.0|34|0.07|0|0.0|30|0.06|0|0.0 arduino:sam:arduino_due_x_dbg|32|0.01|N/A|N/A|24|0.0|N/A|N/A|32|0.01|N/A|N/A|24|0.0|N/A|N/A|32|0.01|N/A|N/A|0|0.0|N/A|N/A|24|0.0|N/A|N/A|16|0.0|N/A|N/A|24|0.0|N/A|N/A|32|0.01|N/A|N/A|32|0.01|N/A|N/A|32|0.01|N/A|N/A arduino:samd:arduino_zero_edbg|28|0.01|0|0.0|28|0.01|0|0.0|28|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|0|0.0|0|0.0|28|0.01|0|0.0|20|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|32|0.01|0|0.0|28|0.01|0|0.0 arduino:samd:mkr1000|28|0.01|0|0.0|28|0.01|0|0.0|28|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|0|0.0|0|0.0|28|0.01|0|0.0|20|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|32|0.01|0|0.0|28|0.01|0|0.0 arduino:samd:mkrfox1200|28|0.01|0|0.0|28|0.01|0|0.0|28|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|0|0.0|0|0.0|28|0.01|0|0.0|20|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|32|0.01|0|0.0|28|0.01|0|0.0 arduino:samd:mkrgsm1400|28|0.01|0|0.0|28|0.01|0|0.0|28|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|0|0.0|0|0.0|28|0.01|0|0.0|20|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|32|0.01|0|0.0|28|0.01|0|0.0 arduino:samd:mkrnb1500|28|0.01|0|0.0|28|0.01|0|0.0|28|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|0|0.0|0|0.0|28|0.01|0|0.0|20|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|32|0.01|0|0.0|28|0.01|0|0.0 arduino:samd:mkrvidor4000|28|0.01|0|0.0|28|0.01|0|0.0|28|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|0|0.0|0|0.0|28|0.01|0|0.0|20|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|32|0.01|0|0.0|28|0.01|0|0.0 arduino:samd:mkrwan1300|28|0.01|0|0.0|28|0.01|0|0.0|28|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|0|0.0|0|0.0|28|0.01|0|0.0|20|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|32|0.01|0|0.0|28|0.01|0|0.0 arduino:samd:mkrwan1310|28|0.01|0|0.0|28|0.01|0|0.0|28|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|0|0.0|0|0.0|28|0.01|0|0.0|20|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|32|0.01|0|0.0|28|0.01|0|0.0 arduino:samd:mkrwifi1010|28|0.01|0|0.0|28|0.01|0|0.0|28|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|0|0.0|0|0.0|28|0.01|0|0.0|20|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|32|0.01|0|0.0|28|0.01|0|0.0 arduino:samd:mkrzero|28|0.01|0|0.0|28|0.01|0|0.0|28|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|0|0.0|0|0.0|28|0.01|0|0.0|20|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|32|0.01|0|0.0|28|0.01|0|0.0 arduino:samd:nano_33_iot|28|0.01|0|0.0|28|0.01|0|0.0|28|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|0|0.0|0|0.0|28|0.01|0|0.0|20|0.01|0|0.0|24|0.01|0|0.0|32|0.01|0|0.0|32|0.01|0|0.0|28|0.01|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/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,30,0.1,0,0.0,30,0.1,0,0.0,30,0.1,0,0.0,36,0.13,0,0.0,34,0.12,0,0.0,0,0.0,0,0.0,30,0.1,0,0.0,24,0.08,0,0.0,36,0.13,0,0.0,34,0.12,0,0.0,34,0.12,0,0.0,30,0.1,0,0.0 arduino:avr:mega,30,0.01,0,0.0,30,0.01,0,0.0,30,0.01,0,0.0,36,0.01,0,0.0,34,0.01,0,0.0,0,0.0,0,0.0,30,0.01,0,0.0,24,0.01,0,0.0,36,0.01,0,0.0,34,0.01,0,0.0,34,0.01,0,0.0,30,0.01,0,0.0 arduino:avr:nano,30,0.1,0,0.0,30,0.1,0,0.0,30,0.1,0,0.0,36,0.12,0,0.0,34,0.11,0,0.0,0,0.0,0,0.0,30,0.1,0,0.0,24,0.08,0,0.0,36,0.12,0,0.0,34,0.11,0,0.0,34,0.11,0,0.0,30,0.1,0,0.0 arduino:megaavr:nona4809,30,0.06,0,0.0,30,0.06,0,0.0,30,0.06,0,0.0,36,0.07,0,0.0,34,0.07,0,0.0,0,0.0,0,0.0,30,0.06,0,0.0,24,0.05,0,0.0,36,0.07,0,0.0,34,0.07,0,0.0,34,0.07,0,0.0,30,0.06,0,0.0 arduino:megaavr:uno2018,30,0.06,0,0.0,30,0.06,0,0.0,30,0.06,0,0.0,36,0.07,0,0.0,34,0.07,0,0.0,0,0.0,0,0.0,30,0.06,0,0.0,24,0.05,0,0.0,36,0.07,0,0.0,34,0.07,0,0.0,34,0.07,0,0.0,30,0.06,0,0.0 arduino:sam:arduino_due_x_dbg,32,0.01,N/A,N/A,24,0.0,N/A,N/A,32,0.01,N/A,N/A,24,0.0,N/A,N/A,32,0.01,N/A,N/A,0,0.0,N/A,N/A,24,0.0,N/A,N/A,16,0.0,N/A,N/A,24,0.0,N/A,N/A,32,0.01,N/A,N/A,32,0.01,N/A,N/A,32,0.01,N/A,N/A arduino:samd:arduino_zero_edbg,28,0.01,0,0.0,28,0.01,0,0.0,28,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,0,0.0,0,0.0,28,0.01,0,0.0,20,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,28,0.01,0,0.0 arduino:samd:mkr1000,28,0.01,0,0.0,28,0.01,0,0.0,28,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,0,0.0,0,0.0,28,0.01,0,0.0,20,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,28,0.01,0,0.0 arduino:samd:mkrfox1200,28,0.01,0,0.0,28,0.01,0,0.0,28,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,0,0.0,0,0.0,28,0.01,0,0.0,20,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,28,0.01,0,0.0 arduino:samd:mkrgsm1400,28,0.01,0,0.0,28,0.01,0,0.0,28,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,0,0.0,0,0.0,28,0.01,0,0.0,20,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,28,0.01,0,0.0 arduino:samd:mkrnb1500,28,0.01,0,0.0,28,0.01,0,0.0,28,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,0,0.0,0,0.0,28,0.01,0,0.0,20,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,28,0.01,0,0.0 arduino:samd:mkrvidor4000,28,0.01,0,0.0,28,0.01,0,0.0,28,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,0,0.0,0,0.0,28,0.01,0,0.0,20,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,28,0.01,0,0.0 arduino:samd:mkrwan1300,28,0.01,0,0.0,28,0.01,0,0.0,28,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,0,0.0,0,0.0,28,0.01,0,0.0,20,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,28,0.01,0,0.0 arduino:samd:mkrwan1310,28,0.01,0,0.0,28,0.01,0,0.0,28,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,0,0.0,0,0.0,28,0.01,0,0.0,20,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,28,0.01,0,0.0 arduino:samd:mkrwifi1010,28,0.01,0,0.0,28,0.01,0,0.0,28,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,0,0.0,0,0.0,28,0.01,0,0.0,20,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,28,0.01,0,0.0 arduino:samd:mkrzero,28,0.01,0,0.0,28,0.01,0,0.0,28,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,0,0.0,0,0.0,28,0.01,0,0.0,20,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,28,0.01,0,0.0 arduino:samd:nano_33_iot,28,0.01,0,0.0,28,0.01,0,0.0,28,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,0,0.0,0,0.0,28,0.01,0,0.0,20,0.01,0,0.0,24,0.01,0,0.0,32,0.01,0,0.0,32,0.01,0,0.0,28,0.01,0,0.0 ```