8000 Allow Ethernet devices on SPI1 (#1725) · abdukir/arduino-pico@7e8fcc5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7e8fcc5

Browse files
authored
Allow Ethernet devices on SPI1 (earlephilhower#1725)
_spiUnit is a reference, and when initialized with SPI, it cannot be changed in the constructor afterwards. So initialize it in the constructor's declaration.
1 parent 39238a5 commit 7e8fcc5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

libraries/lwIP_Ethernet/src/LwipIntfDev.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ template<class RawDev>
5757
class LwipIntfDev: public LwipIntf, public RawDev {
5858
public:
5959
LwipIntfDev(int8_t cs = SS, SPIClass& spi = SPI, int8_t intr = -1) :
60-
RawDev(cs, spi, intr), _mtu(DEFAULT_MTU), _intrPin(intr), _started(false), _default(false) {
61-
_spiUnit = spi;
60+
RawDev(cs, spi, intr), _spiUnit(spi), _mtu(DEFAULT_MTU), _intrPin(intr), _started(false), _default(false) {
6261
memset(&_netif, 0, sizeof(_netif));
6362
}
6463

@@ -135,7 +134,7 @@ class LwipIntfDev: public LwipIntf, public RawDev {
135134
err_t handlePackets();
136135
protected:
137136
// members
138-
SPIClass &_spiUnit = SPI;
137+
SPIClass& _spiUnit;
139138
SPISettings _spiSettings = SPISettings(4000000, MSBFIRST, SPI_MODE0);
140139
netif _netif;
141140

0 commit comments

Comments
 (0)
0