Skip to content

Commit c3f2c20

Browse files
committed
Use generic define BOARD_ESP to check build options
1 parent f9a0ed9 commit c3f2c20

File tree

12 files changed

+35
-15
lines changed

12 files changed

+35
-15
lines changed

examples/ArduinoIoTCloud-Advanced/arduino_secrets.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <ArduinoIoTCloud.h>
12
#include <Arduino_ConnectionHandler.h>
23

34
/* MKR1000, MKR WiFi 1010 */
@@ -6,8 +7,8 @@
67
#define SECRET_PASS "YOUR_WIFI_PASSWORD"
78
#endif
89

9-
/* ESP8266 */
10-
#if defined(BOARD_ESP8266)
10+
/* ESP8266 ESP32*/
11+
#if defined(BOARD_ESP)
1112
#define SECRET_DEVICE_KEY "my-device-password"
1213
#endif
1314

examples/ArduinoIoTCloud-Advanced/thingProperties.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ CloudLocation location;
1111
CloudColor color;
1212

1313
void initProperties() {
14-
#if defined(BOARD_ESP8266)
14+
#if defined(BOARD_ESP)
1515
ArduinoCloud.setBoardId(BOARD_ID);
1616
ArduinoCloud.setSecretDeviceKey(SECRET_DEVICE_KEY);
1717
#endif

examples/ArduinoIoTCloud-Basic/arduino_secrets.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#endif
88

99
/* ESP8266 */
10-
#if defined(BOARD_ESP8266)
10+
#if defined(BOARD_ESP)
1111
#define SECRET_DEVICE_KEY "my-device-password"
1212
#endif
1313

examples/ArduinoIoTCloud-Basic/thingProperties.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ int potentiometer;
1818
int seconds;
1919

2020
void initProperties() {
21-
#if defined(BOARD_ESP8266)
21+
#if defined(BOARD_ESP)
2222
ArduinoCloud.setBoardId(BOARD_ID);
2323
ArduinoCloud.setSecretDeviceKey(SECRET_DEVICE_KEY);
2424
#endif

examples/ArduinoIoTCloud-Callbacks/arduino_secrets.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <ArduinoIoTCloud.h>
12
#include <Arduino_ConnectionHandler.h>
23

34
/* MKR1000, MKR WiFi 1010 */
@@ -6,8 +7,8 @@
67
#define SECRET_PASS "YOUR_WIFI_PASSWORD"
78
#endif
89

9-
/* ESP8266 */
10-
#if defined(BOARD_ESP8266)
10+
/* ESP8266 ESP32*/
11+
#if defined(BOARD_ESP)
1112
#define SECRET_DEVICE_KEY "my-device-password"
1213
#endif
1314

examples/ArduinoIoTCloud-Callbacks/thingProperties.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
1414

1515
void initProperties() {
16-
#if defined(BOARD_ESP8266)
16+
#if defined(BOARD_ESP)
1717
ArduinoCloud.setBoardId(BOARD_ID);
1818
ArduinoCloud.setSecretDeviceKey(SECRET_DEVICE_KEY);
1919
#endif

examples/ArduinoIoTCloud-DeferredOTA/arduino_secrets.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <ArduinoIoTCloud.h>
12
#include <Arduino_ConnectionHandler.h>
23

34
/* MKR1000, MKR WiFi 1010 */
@@ -6,8 +7,8 @@
67
#define SECRET_PASS "YOUR_WIFI_PASSWORD"
78
#endif
89

9-
/* ESP8266 */
10-
#if defined(BOARD_ESP8266)
10+
/* ESP8266 ESP32*/
11+
#if defined(BOARD_ESP)
1112
#define SECRET_DEVICE_KEY "my-device-password"
1213
#endif
1314

examples/ArduinoIoTCloud-DeferredOTA/thingProperties.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void onLedChange();
1616
bool led;
1717

1818
void initProperties() {
19-
#if defined(BOARD_ESP8266)
19+
#if defined(BOARD_ESP)
2020
ArduinoCloud.setBoardId(BOARD_ID);
2121
ArduinoCloud.setSecretDeviceKey(SECRET_DEVICE_KEY);
2222
#endif

examples/ArduinoIoTCloud-Schedule/arduino_secrets.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <ArduinoIoTCloud.h>
12
#include <Arduino_ConnectionHandler.h>
23

34
/* MKR1000, MKR WiFi 1010 */
@@ -6,8 +7,8 @@
67
#define SECRET_PASS "YOUR_WIFI_PASSWORD"
78
#endif
89

9-
/* ESP8266 */
10-
#if defined(BOARD_ESP8266)
10+
/* ESP8266 ESP32*/
11+
#if defined(BOARD_ESP)
1112
#define SECRET_DEVICE_KEY "my-device-password"
1213
#endif
1314

examples/ArduinoIoTCloud-Schedule/thingProperties.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ CloudSchedule monthly;
1515
CloudSchedule yearly;
1616

1717
void initProperties() {
18-
#if defined(BOARD_ESP8266)
18+
#if defined(BOARD_ESP)
1919
ArduinoCloud.setBoardId(BOARD_ID);
2020
ArduinoCloud.setSecretDeviceKey(SECRET_DEVICE_KEY);
2121
#endif

examples/utility/ArduinoIoTCloud_Travis_CI/arduino_secrets.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <ArduinoIoTCloud.h>
12
#include <Arduino_ConnectionHandler.h>
23

34
/* MKR1000, MKR WiFi 1010 */
@@ -6,6 +7,11 @@
67
#define SECRET_PASS "YOUR_WIFI_PASSWORD"
78
#endif
89

10+
/* ESP8266 ESP32*/
11+
#if defined(BOARD_ESP)
12+
#define SECRET_DEVICE_KEY "my-device-password"
13+
#endif
14+
915
/* MKR GSM 1400 */
1016
#if defined(BOARD_HAS_GSM)
1117
#define SECRET_PIN ""

examples/utility/ArduinoIoTCloud_Travis_CI/thingProperties.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
#error "Arduino IoT Cloud currently only supports MKR1000, MKR WiFi 1010, MKR WAN 1300/1310, MKR NB 1500 and MKR GSM 1400"
1414
#endif
1515

16+
/******************************************************************************
17+
DEFINES
18+
******************************************************************************/
19+
20+
#define THING_ID "ARDUINO_IOT_CLOUD_THING_ID"
21+
#define BOARD_ID "ARDUINO_IOT_CLOUD_BOARD_ID"
22+
1623
/******************************************************************************
1724
GLOBAL CONSTANTS
1825
******************************************************************************/
@@ -72,7 +79,10 @@ void onStringPropertyChange();
7279
******************************************************************************/
7380
#if defined(BOARD_HAS_WIFI) || defined(BOARD_HAS_GSM) || defined (BOARD_HAS_NB)
7481
void initProperties() {
75-
82+
#if defined(BOARD_ESP)
83+
ArduinoCloud.setBoardId(BOARD_ID);
84+
ArduinoCloud.setSecretDeviceKey(SECRET_DEVICE_KEY);
85+
#endif
7686
ArduinoCloud.addProperty(bool_property_1, READWRITE, 1 * SECONDS);
7787
ArduinoCloud.addProperty(int_property_1, READ, 2 * MINUTES);
7888
ArduinoCloud.addProperty(float_property_1, WRITE, 3 * HOURS);

0 commit comments

Comments
 (0)