Skip to content

Commit a62b28c

Browse files
authored
Automatically configure OTA for MKRMEM/SFU if the define OTA_STORAGE_MKRMEM is set (#155)
1 parent 42f0f2f commit a62b28c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Diff for: src/ArduinoIoTCloudTCP.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#include "tls/utility/CryptoUtil.h"
3030
#endif
3131

32+
#include "utility/ota/OTAStorage_MKRMEM.h"
33+
3234
#include "cbor/CBOREncoder.h"
3335

3436
/******************************************************************************
@@ -37,6 +39,10 @@
3739

3840
TimeService time_service;
3941

42+
#if OTA_STORAGE_MKRMEM
43+
static OTAStorage_MKRMEM ota_storage_sfu;
44+
#endif /* OTA_STORAGE_MKRMEM */
45+
4046
/******************************************************************************
4147
GLOBAL CONSTANTS
4248
******************************************************************************/
@@ -135,6 +141,10 @@ int ArduinoIoTCloudTCP::begin(String brokerAddress, uint16_t brokerPort)
135141

136142
printConnectionStatus(_iot_status);
137143

144+
#if OTA_STORAGE_MKRMEM
145+
setOTAStorage(ota_storage_sfu);
146+
#endif /* OTA_STORAGE_MKRMEM */
147+
138148
return 1;
139149
}
140150

Diff for: src/utility/ota/OTAStorage_MKRMEM.h

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
#include "OTAStorage.h"
2929

30+
#include <SFU.h>
31+
3032
#include <Arduino_MKRMEM.h>
3133

3234
/******************************************************************************

0 commit comments

Comments
 (0)