From 37ae4804f9eef3586ba8e18de4f0a3595689fc7e Mon Sep 17 00:00:00 2001 From: "Zachary J. Fields" Date: Wed, 24 Jul 2024 23:12:31 -0500 Subject: [PATCH] chore: Enable IDE compilation --- .../arduino_secrets.h | 2 +- .../ArduinoIoTCloud-Basic/arduino_secrets.h | 2 +- .../arduino_secrets.h | 2 +- .../arduino_secrets.h | 2 +- .../arduino_secrets.h | 2 +- .../arduino_secrets.h | 2 +- src/AIoTC_Config.h | 6 +++++ src/ArduinoIoTCloudNotecard.cpp | 2 +- src/utility/time/RTCMillis.cpp | 2 ++ src/utility/time/TimeService.cpp | 27 ++++++------------- 10 files changed, 23 insertions(+), 26 deletions(-) diff --git a/examples/ArduinoIoTCloud-Advanced/arduino_secrets.h b/examples/ArduinoIoTCloud-Advanced/arduino_secrets.h index 44a9e21d..48f14eb5 100644 --- a/examples/ArduinoIoTCloud-Advanced/arduino_secrets.h +++ b/examples/ArduinoIoTCloud-Advanced/arduino_secrets.h @@ -3,7 +3,7 @@ /* A complete list of supported boards with WiFi is available here: * https://github.com/arduino-libraries/ArduinoIoTCloud/#what */ -#if defined(BOARD_HAS_WIFI) +#if defined(USE_NOTECARD) || defined(BOARD_HAS_WIFI) #define SECRET_WIFI_SSID "YOUR_WIFI_NETWORK_NAME" #define SECRET_WIFI_PASS "YOUR_WIFI_PASSWORD" #endif diff --git a/examples/ArduinoIoTCloud-Basic/arduino_secrets.h b/examples/ArduinoIoTCloud-Basic/arduino_secrets.h index 44a9e21d..48f14eb5 100644 --- a/examples/ArduinoIoTCloud-Basic/arduino_secrets.h +++ b/examples/ArduinoIoTCloud-Basic/arduino_secrets.h @@ -3,7 +3,7 @@ /* A complete list of supported boards with WiFi is available here: * https://github.com/arduino-libraries/ArduinoIoTCloud/#what */ -#if defined(BOARD_HAS_WIFI) +#if defined(USE_NOTECARD) || defined(BOARD_HAS_WIFI) #define SECRET_WIFI_SSID "YOUR_WIFI_NETWORK_NAME" #define SECRET_WIFI_PASS "YOUR_WIFI_PASSWORD" #endif diff --git a/examples/ArduinoIoTCloud-Callbacks/arduino_secrets.h b/examples/ArduinoIoTCloud-Callbacks/arduino_secrets.h index 44a9e21d..48f14eb5 100644 --- a/examples/ArduinoIoTCloud-Callbacks/arduino_secrets.h +++ b/examples/ArduinoIoTCloud-Callbacks/arduino_secrets.h @@ -3,7 +3,7 @@ /* A complete list of supported boards with WiFi is available here: * https://github.com/arduino-libraries/ArduinoIoTCloud/#what */ -#if defined(BOARD_HAS_WIFI) +#if defined(USE_NOTECARD) || defined(BOARD_HAS_WIFI) #define SECRET_WIFI_SSID "YOUR_WIFI_NETWORK_NAME" #define SECRET_WIFI_PASS "YOUR_WIFI_PASSWORD" #endif diff --git a/examples/ArduinoIoTCloud-DeferredOTA/arduino_secrets.h b/examples/ArduinoIoTCloud-DeferredOTA/arduino_secrets.h index e784c441..ced6852a 100644 --- a/examples/ArduinoIoTCloud-DeferredOTA/arduino_secrets.h +++ b/examples/ArduinoIoTCloud-DeferredOTA/arduino_secrets.h @@ -3,7 +3,7 @@ /* A complete list of supported boards with WiFi is available here: * https://github.com/arduino-libraries/ArduinoIoTCloud/#what */ -#if defined(BOARD_HAS_WIFI) +#if defined(USE_NOTECARD) || defined(BOARD_HAS_WIFI) #define SECRET_WIFI_SSID "YOUR_WIFI_NETWORK_NAME" #define SECRET_WIFI_PASS "YOUR_WIFI_PASSWORD" #endif diff --git a/examples/ArduinoIoTCloud-Schedule/arduino_secrets.h b/examples/ArduinoIoTCloud-Schedule/arduino_secrets.h index 44a9e21d..48f14eb5 100644 --- a/examples/ArduinoIoTCloud-Schedule/arduino_secrets.h +++ b/examples/ArduinoIoTCloud-Schedule/arduino_secrets.h @@ -3,7 +3,7 @@ /* A complete list of supported boards with WiFi is available here: * https://github.com/arduino-libraries/ArduinoIoTCloud/#what */ -#if defined(BOARD_HAS_WIFI) +#if defined(USE_NOTECARD) || defined(BOARD_HAS_WIFI) #define SECRET_WIFI_SSID "YOUR_WIFI_NETWORK_NAME" #define SECRET_WIFI_PASS "YOUR_WIFI_PASSWORD" #endif diff --git a/examples/utility/ArduinoIoTCloud_Travis_CI/arduino_secrets.h b/examples/utility/ArduinoIoTCloud_Travis_CI/arduino_secrets.h index 2ae0cefa..ed0ec7fe 100644 --- a/examples/utility/ArduinoIoTCloud_Travis_CI/arduino_secrets.h +++ b/examples/utility/ArduinoIoTCloud_Travis_CI/arduino_secrets.h @@ -3,7 +3,7 @@ /* A complete list of supported boards with WiFi is available here: * https://github.com/arduino-libraries/ArduinoIoTCloud/#what */ -#if defined(BOARD_HAS_WIFI) +#if defined(USE_NOTECARD) || defined(BOARD_HAS_WIFI) #define SECRET_WIFI_SSID "YOUR_WIFI_NETWORK_NAME" #define SECRET_WIFI_PASS "YOUR_WIFI_PASSWORD" #endif diff --git a/src/AIoTC_Config.h b/src/AIoTC_Config.h index 4c1bd899..8e66a1c3 100644 --- a/src/AIoTC_Config.h +++ b/src/AIoTC_Config.h @@ -18,6 +18,12 @@ #ifndef ARDUINO_AIOTC_CONFIG_H_ #define ARDUINO_AIOTC_CONFIG_H_ +#if defined __has_include + #if __has_include () + #define USE_NOTECARD + #endif +#endif + #include /****************************************************************************** diff --git a/src/ArduinoIoTCloudNotecard.cpp b/src/ArduinoIoTCloudNotecard.cpp index 58b74f87..267dfb5e 100644 --- a/src/ArduinoIoTCloudNotecard.cpp +++ b/src/ArduinoIoTCloudNotecard.cpp @@ -211,7 +211,7 @@ ArduinoIoTCloudNotecard::State ArduinoIoTCloudNotecard::handle_ConfigureNotehub( #if defined(BOARD_HAS_SECRET_KEY) if (reinterpret_cast(_connection)->syncSecretDeviceKey(_secret_device_key)) { DEBUG_WARNING("ArduinoIoTCloudNotecard::%s failed to set secret device key", __FUNCTION__); - DEBUG_WARNING("You may manually enter the secret key on Notehub as a device level environment variable named `arduino_iot_cloud_secret_key`"); + DEBUG_WARNING("You may manually enter the secret key on Notehub as a device level environment variable named `arduino_iot_cloud_secret_device_key`"); } #endif diff --git a/src/utility/time/RTCMillis.cpp b/src/utility/time/RTCMillis.cpp index 81160382..63d6c44e 100644 --- a/src/utility/time/RTCMillis.cpp +++ b/src/utility/time/RTCMillis.cpp @@ -19,6 +19,8 @@ * INCLUDE **************************************************************************************/ +#include "AIoTC_Config.h" + #if defined(USE_NOTECARD) || defined(ARDUINO_ARCH_ESP8266) #include diff --git a/src/utility/time/TimeService.cpp b/src/utility/time/TimeService.cpp index 1281696e..992f228e 100644 --- a/src/utility/time/TimeService.cpp +++ b/src/utility/time/TimeService.cpp @@ -19,35 +19,24 @@ * INCLUDE **************************************************************************************/ -#include #include -#include "TimeService.h" -#include "NTPUtils.h" + +#include "AIoTC_Config.h" #include "AIoTC_Const.h" +#include "NTPUtils.h" +#include "TimeService.h" -#ifdef USE_NOTECARD +#if defined(USE_NOTECARD) || defined(ARDUINO_ARCH_ESP8266) #include "RTCMillis.h" -#else - -#ifdef ARDUINO_ARCH_SAMD +#elif defined(ARDUINO_ARCH_SAMD) #include -#endif - -#ifdef ARDUINO_ARCH_MBED +#elif defined(ARDUINO_ARCH_MBED) #include -#endif - -#ifdef ARDUINO_ARCH_ESP8266 - #include "RTCMillis.h" -#endif - -#ifdef ARDUINO_ARCH_RENESAS +#elif defined(ARDUINO_ARCH_RENESAS) #include "RTC.h" #endif -#endif /* USE_NOTECARD */ - /************************************************************************************** * GLOBAL VARIABLES **************************************************************************************/