File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 5
5
int arduino::EthernetClass::begin (uint8_t *mac, unsigned long timeout, unsigned long responseTimeout) {
6
6
if (eth_if == nullptr ) {
7
7
// Q: What is the callback for?
8
- _initializerCallback ();
8
+ // A: To call a specific function on your system before any initialization is performed
9
+ if (_initializerCallback != nullptr ) {
10
+ _initializerCallback ();
11
+ }
9
12
if (eth_if == nullptr ) return 0 ;
10
13
}
11
14
eth_if->set_dhcp (true );
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ class EthernetClass : public MbedSocketClass {
121
121
volatile EthernetLinkStatus _currentNetworkStatus = Unknown;
122
122
EthernetInterface net;
123
123
EthernetInterface *eth_if = &net;
124
- voidPrtFuncPtr _initializerCallback;
124
+ voidPrtFuncPtr _initializerCallback = nullptr ;
125
125
arduino::IPAddress ipAddressFromSocketAddress (SocketAddress socketAddress);
126
126
};
127
127
You can’t perform that action at this time.
0 commit comments