Skip to content

Commit

Permalink
chore: Enable IDE compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
zfields committed Jul 25, 2024
1 parent a8e89dc commit 37ae480
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 26 deletions.
2 changes: 1 addition & 1 deletion examples/ArduinoIoTCloud-Advanced/arduino_secrets.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/ArduinoIoTCloud-Basic/arduino_secrets.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/ArduinoIoTCloud-Callbacks/arduino_secrets.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/ArduinoIoTCloud-DeferredOTA/arduino_secrets.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/ArduinoIoTCloud-Schedule/arduino_secrets.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/AIoTC_Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
#ifndef ARDUINO_AIOTC_CONFIG_H_
#define ARDUINO_AIOTC_CONFIG_H_

#if defined __has_include
#if __has_include (<Notecard.h>)
#define USE_NOTECARD
#endif
#endif

#include <ArduinoECCX08Config.h>

/******************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion src/ArduinoIoTCloudNotecard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ ArduinoIoTCloudNotecard::State ArduinoIoTCloudNotecard::handle_ConfigureNotehub(
#if defined(BOARD_HAS_SECRET_KEY)
if (reinterpret_cast<NotecardConnectionHandler *>(_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

Expand Down
2 changes: 2 additions & 0 deletions src/utility/time/RTCMillis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* INCLUDE
**************************************************************************************/

#include "AIoTC_Config.h"

#if defined(USE_NOTECARD) || defined(ARDUINO_ARCH_ESP8266)

#include <Arduino.h>
Expand Down
27 changes: 8 additions & 19 deletions src/utility/time/TimeService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,24 @@
* INCLUDE
**************************************************************************************/

#include <AIoTC_Config.h>

#include <time.h>
#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 <RTCZero.h>
#endif

#ifdef ARDUINO_ARCH_MBED
#elif defined(ARDUINO_ARCH_MBED)
#include <mbed_rtc_time.h>
#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
**************************************************************************************/
Expand Down

0 comments on commit 37ae480

Please sign in to comment.