Skip to content

Commit 22d1301

Browse files
committed
Fix bug that sets pin 10 to INPUT on WiFi boards
netConnectionState being initialized to NetworkConnectionState::DISCONNECTED caused the WiFiNINA library's SpiDrv::end() to be called before SpiDrv::begin(). Since SLAVESELECT is initialized to 10, and only assigned SPIWIFI_SS in SpiDrv::begin(), this causes pin 10 to be set to INPUT. Since pin 10 is MISO on the MKR boards, and often used as CS on the Nano 33 IoT, and WiFiConnectionHandler::update() is typically called from loop(), after SPI has already been configured, this breaks communication on SPI.
1 parent 5694e24 commit 22d1301

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Arduino_ConnectionHandler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ class ConnectionHandler {
162162
_on_error_event_callback = NULL;
163163

164164
unsigned long lastValidTimestamp = 0; /* UNUSED */
165-
NetworkConnectionState netConnectionState = NetworkConnectionState::DISCONNECTED;
165+
NetworkConnectionState netConnectionState = NetworkConnectionState::INIT;
166166

167167
static void execNetworkEventCallback(OnNetworkEventCallback & callback, void * callback_arg);
168168

0 commit comments

Comments
 (0)