Unverified Commit 7e8fcc5a authored by Dom's avatar Dom Committed by GitHub

Allow Ethernet devices on SPI1 (#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.
parent 39238a50
......@@ -57,8 +57,7 @@ template<class RawDev>
class LwipIntfDev: public LwipIntf, public RawDev {
public:
LwipIntfDev(int8_t cs = SS, SPIClass& spi = SPI, int8_t intr = -1) :
RawDev(cs, spi, intr), _mtu(DEFAULT_MTU), _intrPin(intr), _started(false), _default(false) {
_spiUnit = spi;
RawDev(cs, spi, intr), _spiUnit(spi), _mtu(DEFAULT_MTU), _intrPin(intr), _started(false), _default(false) {
memset(&_netif, 0, sizeof(_netif));
}
......@@ -135,7 +134,7 @@ public:
err_t handlePackets();
protected:
// members
SPIClass &_spiUnit = SPI;
SPIClass& _spiUnit;
SPISettings _spiSettings = SPISettings(4000000, MSBFIRST, SPI_MODE0);
netif _netif;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment