@@ -25,8 +25,7 @@ void EthernetController::handleCommand(const TerminalCommand& cmd) {
2525/*
2626Connect using DHCP
2727*/
28- void EthernetController::handleConnect () {
29-
28+ void EthernetController::handleConnect () {
3029 unsigned long timeoutMs = 5000 ;
3130
3231 terminalView.println (" Ethernet: DHCP…" );
@@ -86,7 +85,7 @@ void EthernetController::handleConfig() {
8685 .readValidatedUint8 (" SPI frequency (MHz)" , defMhz, 1 , 80 )
8786 * 1000000 ;
8887
89- // MAC addr ( optional)
88+ // MAC addr optional
9089 std::string macStr;
9190 std::array<uint8_t ,6 > mac = state.getEthernetMac ();
9291
@@ -172,7 +171,7 @@ Reset
172171void EthernetController::handleReset ()
173172{
174173 ethernetService.hardReset ();
175- terminalView.println (" Ethernet: Interface reset. Disconnected. [NYI] ." );
174+ terminalView.println (" Ethernet: Interface reset via RST pin ." );
176175}
177176
178177/*
@@ -198,10 +197,12 @@ void EthernetController::ensureConfigured() {
198197 auto sck = state.getEthernetSckPin ();
199198 auto miso = state.getEthernetMisoPin ();
200199 auto mosi = state.getEthernetMosiPin ();
201- auto rst = state.getEthernetRstPin ();
200+ auto rst_u8 = state.getEthernetRstPin ();
202201 auto irq = state.getEthernetIrqPin ();
203202 auto frequency = state.getEthernetFrequency ();
204203 auto mac = state.getEthernetMac ();
205204
206- ethernetService.configure (cs, rst, sck, miso, mosi, irq, frequency, mac);
205+ int8_t rst = (rst_u8 == 255 ) ? -1 : (int8_t )rst_u8;
206+
207+ ethernetService.configure (cs, rst, sck, miso, mosi, irq, frequency, mac, &deviceView.getSharedSpiInstance ());
207208}
0 commit comments