@@ -16,22 +16,22 @@ int EthernetClass::begin(uint8_t *mac_address, unsigned long timeout, unsigned l
16
16
17
17
// Initialise the basic info
18
18
W5100.init ();
19
- SPI .beginTransaction (SPI_ETHERNET_SETTINGS);
19
+ SPI_ETH .beginTransaction (SPI_ETHERNET_SETTINGS);
20
20
W5100.setMACAddress (mac_address);
21
21
W5100.setIPAddress (IPAddress (0 ,0 ,0 ,0 ).raw_address ());
22
- SPI .endTransaction ();
22
+ SPI_ETH .endTransaction ();
23
23
24
24
// Now try to get our config info from a DHCP server
25
25
int ret = _dhcp->beginWithDHCP (mac_address, timeout, responseTimeout);
26
26
if (ret == 1 )
27
27
{
28
28
// We've successfully found a DHCP server and got our configuration info, so set things
29
29
// accordingly
30
- SPI .beginTransaction (SPI_ETHERNET_SETTINGS);
30
+ SPI_ETH .beginTransaction (SPI_ETHERNET_SETTINGS);
31
31
W5100.setIPAddress (_dhcp->getLocalIp ().raw_address ());
32
32
W5100.setGatewayIp (_dhcp->getGatewayIp ().raw_address ());
33
33
W5100.setSubnetMask (_dhcp->getSubnetMask ().raw_address ());
34
- SPI .endTransaction ();
34
+ SPI_ETH .endTransaction ();
35
35
_dnsServerAddress = _dhcp->getDnsServerIp ();
36
36
}
37
37
@@ -65,12 +65,12 @@ void EthernetClass::begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dn
65
65
void EthernetClass::begin (uint8_t *mac, IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet)
66
66
{
67
67
W5100.init ();
68
- SPI .beginTransaction (SPI_ETHERNET_SETTINGS);
68
+ SPI_ETH .beginTransaction (SPI_ETHERNET_SETTINGS);
69
69
W5100.setMACAddress (mac);
70
70
W5100.setIPAddress (local_ip.raw_address ());
71
71
W5100.setGatewayIp (gateway.raw_address ());
72
72
W5100.setSubnetMask (subnet.raw_address ());
73
- SPI .endTransaction ();
73
+ SPI_ETH .endTransaction ();
74
74
_dnsServerAddress = dns_server;
75
75
}
76
76
@@ -86,11 +86,11 @@ int EthernetClass::maintain(){
86
86
case DHCP_CHECK_RENEW_OK:
87
87
case DHCP_CHECK_REBIND_OK:
88
88
// we might have got a new IP.
89
- SPI .beginTransaction (SPI_ETHERNET_SETTINGS);
89
+ SPI_ETH .beginTransaction (SPI_ETHERNET_SETTINGS);
90
90
W5100.setIPAddress (_dhcp->getLocalIp ().raw_address ());
91
91
W5100.setGatewayIp (_dhcp->getGatewayIp ().raw_address ());
92
92
W5100.setSubnetMask (_dhcp->getSubnetMask ().raw_address ());
93
- SPI .endTransaction ();
93
+ SPI_ETH .endTransaction ();
94
94
_dnsServerAddress = _dhcp->getDnsServerIp ();
95
95
break ;
96
96
default :
@@ -104,27 +104,27 @@ int EthernetClass::maintain(){
104
104
IPAddress EthernetClass::localIP ()
105
105
{
106
106
IPAddress ret;
107
- SPI .beginTransaction (SPI_ETHERNET_SETTINGS);
107
+ SPI_ETH .beginTransaction (SPI_ETHERNET_SETTINGS);
108
108
W5100.getIPAddress (ret.raw_address ());
109
- SPI .endTransaction ();
109
+ SPI_ETH .endTransaction ();
110
110
return ret;
111
111
}
112
112
113
113
IPAddress EthernetClass::subnetMask ()
114
114
{
115
115
IPAddress ret;
116
- SPI .beginTransaction (SPI_ETHERNET_SETTINGS);
116
+ SPI_ETH .beginTransaction (SPI_ETHERNET_SETTINGS);
117
117
W5100.getSubnetMask (ret.raw_address ());
118
- SPI .endTransaction ();
118
+ SPI_ETH .endTransaction ();
119
119
return ret;
120
120
}
121
121
122
122
IPAddress EthernetClass::gatewayIP ()
123
123
{
124
124
IPAddress ret;
125
- SPI .beginTransaction (SPI_ETHERNET_SETTINGS);
125
+ SPI_ETH .beginTransaction (SPI_ETHERNET_SETTINGS);
126
126
W5100.getGatewayIp (ret.raw_address ());
127
- SPI .endTransaction ();
127
+ SPI_ETH .endTransaction ();
128
128
return ret;
129
129
}
130
130
0 commit comments