Skip to content

Commit 971f377

Browse files
brentrubrentru
authored andcommitted
add SPIClass param for setpins
1 parent ac3ab05 commit 971f377

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/wifi/AdafruitIO_AIRLIFT.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,13 @@ class AdafruitIO_AIRLIFT : public AdafruitIO {
5555
A reference to the ESP32_RST Pin.
5656
@param gpio0Pin
5757
A reference to the gpio0Pin Pin.
58+
@param wifi
59+
A reference to a SPIClass
5860
*/
5961
/**************************************************************************/
60-
AdafruitIO_AIRLIFT(const char *user, const char *key, const char *ssid, const char *pass, int ssPin, int ackPin, int rstPin, int gpio0Pin) : AdafruitIO(user, key)
62+
AdafruitIO_AIRLIFT(const char *user, const char *key, const char *ssid, const char *pass, int ssPin, int ackPin, int rstPin, int gpio0Pin, SPIClass* wifi) : AdafruitIO(user, key)
6163
{
64+
_wifi = wifi;
6265
_ssPin = ssPin;
6366
_ackPin = ackPin;
6467
_rstPin = rstPin;
@@ -145,6 +148,8 @@ class AdafruitIO_AIRLIFT : public AdafruitIO {
145148
WiFiSSLClient *_http_client;
146149
WiFiSSLClient *_mqtt_client;
147150

151+
SPIClass *_wifi;
152+
148153
/**************************************************************************/
149154
/*!
150155
@brief Attempts to establish a WiFi connection with the wireless network,
@@ -155,7 +160,7 @@ class AdafruitIO_AIRLIFT : public AdafruitIO {
155160
{
156161
// setup ESP32 pins
157162
if (_ssPin != -1) {
158-
WiFi.setPins(_ssPin, _ackPin, _rstPin, _gpio0Pin, wifi);
163+
WiFi.setPins(_ssPin, _ackPin, _rstPin, _gpio0Pin, _wifi);
159164
}
160165

161166
// check esp32 module version against NINAFWVER

0 commit comments

Comments
 (0)