Skip to content

Commit 8af7200

Browse files
committed
Allow compilation for unit tests regardless of the configuration within ArduinoIoTCloud_Defines.h
1 parent 409ed1f commit 8af7200

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

src/utility/ota/OTALogic.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
* INCLUDE
2020
******************************************************************************/
2121

22-
#include <ArduinoIoTCloud_Config.h>
22+
#ifndef HOST
23+
#include <ArduinoIoTCloud_Config.h>
24+
#else
25+
#define OTA_ENABLED (1)
26+
#endif
2327
#if OTA_ENABLED
2428

2529
#include "OTALogic.h"

src/utility/ota/OTALogic.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222
* INCLUDE
2323
******************************************************************************/
2424

25-
#include <ArduinoIoTCloud_Config.h>
25+
#ifndef HOST
26+
#include <ArduinoIoTCloud_Config.h>
27+
#else
28+
#define OTA_ENABLED (1)
29+
#endif
2630
#if OTA_ENABLED
2731

2832
#include "OTAStorage.h"

src/utility/ota/crc.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
* - Algorithm = table-driven
1515
*/
1616

17-
#include <ArduinoIoTCloud_Config.h>
17+
#ifndef HOST
18+
#include <ArduinoIoTCloud_Config.h>
19+
#else
20+
#define OTA_ENABLED (1)
21+
#endif
1822
#if OTA_ENABLED
1923

2024
#include "crc.h" /* include the header file generated with pycrc */

src/utility/ota/crc.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@
4040
#ifndef CRC_H
4141
#define CRC_H
4242

43-
#include <ArduinoIoTCloud_Config.h>
43+
#ifndef HOST
44+
#include <ArduinoIoTCloud_Config.h>
45+
#else
46+
#define OTA_ENABLED (1)
47+
#endif
4448
#if OTA_ENABLED
4549

4650
#include <stdlib.h>

0 commit comments

Comments
 (0)