Skip to content

Commit 374c1d7

Browse files
brentrubrentru
authored andcommitted
add pins to WINC1500 constructor too
1 parent cfe6846 commit 374c1d7

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

src/wifi/AdafruitIO_AIRLIFT.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ class AdafruitIO_AIRLIFT : public AdafruitIO {
4848
A reference to the WiFi network SSID.
4949
@param pass
5050
A reference to the WiFi network password.
51+
@param ssPin
52+
A reference to the ESP32_SS Pin.
53+
@param ackPin
54+
A reference to the ESP32_ACK Pin.
55+
@param rstPin
56+
A reference to the ESP32_RST Pin.
57+
@param gpio0Pin
58+
A reference to the gpio0Pin Pin.
5159
*/
5260
/**************************************************************************/
5361
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)

src/wifi/AdafruitIO_WINC1500.h

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,15 @@
2121
#include "Adafruit_MQTT.h"
2222
#include "Adafruit_MQTT_Client.h"
2323

24-
// feather wifi m0
25-
#define WINC_CS 8
26-
#define WINC_IRQ 7
27-
#define WINC_RST 4
28-
#define WINC_EN 2
29-
3024
class AdafruitIO_WINC1500 : public AdafruitIO {
3125

3226
public:
33-
AdafruitIO_WINC1500(const char *user, const char *key, const char *ssid, const char *pass, int winc_en, int winc_cs, int winc_irq, int winc_rst) : AdafruitIO(user, key)
27+
AdafruitIO_WINC1500(const char *user, const char *key, const char *ssid, const char *pass, int winc_cs, int winc_irq, int winc_rst, int winc_en) : AdafruitIO(user, key)
3428
{
35-
_winc_en = winc_en;
3629
_winc_cs = winc_cs;
3730
_winc_irq = winc_irq;
3831
_winc_rst = winc_rst;
32+
_winc_en = winc_en;
3933
_ssid = ssid;
4034
_pass = pass;
4135
_mqtt_client = new WiFiSSLClient;
@@ -58,7 +52,6 @@ class AdafruitIO_WINC1500 : public AdafruitIO {
5852

5953
aio_status_t networkStatus()
6054
{
61-
6255
switch (WiFi.status())
6356
{
6457
case WL_CONNECTED:
@@ -71,6 +64,7 @@ class AdafruitIO_WINC1500 : public AdafruitIO {
7164
return AIO_NET_DISCONNECTED;
7265
}
7366
}
67+
7468
const char *connectionType()
7569
{
7670
return "winc1500";
@@ -90,8 +84,10 @@ class AdafruitIO_WINC1500 : public AdafruitIO {
9084
WiFi.setPins(_winc_cs, _winc_irq, _winc_rst, _winc_en);
9185

9286
// no shield? bail
93-
if (WiFi.status() == WL_NO_SHIELD)
87+
if (WiFi.status() == WL_NO_SHIELD) {
88+
AIO_DEBUG_PRINTLN("No WINC1500 Module Detected!");
9489
return;
90+
}
9591

9692
WiFi.begin(_ssid, _pass);
9793
_status = AIO_NET_DISCONNECTED;

0 commit comments

Comments
 (0)