Skip to content

Commit 7f87d0f

Browse files
authored
Fix compilation for use as IDF component (#5265)
1 parent 90fc68d commit 7f87d0f

16 files changed

+29
-21
lines changed

Diff for: CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_ArduinoO
170170
list(APPEND priv_requires esp_https_ota)
171171
endif()
172172
if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_LITTLEFS)
173-
list(APPEND priv_requires esp_littlefs)
173+
if(CONFIG_LITTLEFS_PAGE_SIZE)
174+
list(APPEND priv_requires esp_littlefs)
175+
endif()
174176
endif()
175177

176178
idf_component_register(INCLUDE_DIRS ${includedirs} PRIV_INCLUDE_DIRS ${priv_includes} SRCS ${srcs} REQUIRES ${requires} PRIV_REQUIRES ${priv_requires})

Diff for: docs/esp-idf_component.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ For a simplified method, see [lib-builder](lib_builder.md)
1818
cd arduino && \
1919
git submodule update --init --recursive && \
2020
cd ../.. && \
21-
make menuconfig
21+
idf.py menuconfig
2222
```
23-
- ```make menuconfig``` has some Arduino options
23+
- ```idf.py menuconfig``` has some Arduino options
2424
- "Autostart Arduino setup and loop on boot"
2525
- If you enable this options, your main.cpp should be formated like any other sketch
2626

@@ -60,7 +60,7 @@ For a simplified method, see [lib-builder](lib_builder.md)
6060
- "Autoconnect WiFi on boot"
6161
- If enabled, WiFi will start with the last known configuration
6262
- Else it will wait for WiFi.begin
63-
- ```make flash monitor``` will build, upload and open serial monitor to your board
63+
- ```idf.py -p <your-board-serial-port> flash monitor``` will build, upload and open serial monitor to your board
6464

6565
## Logging To Serial
6666

Diff for: libraries/LITTLEFS/src/LITTLEFS.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@ extern "C" {
2020
#include <sys/unistd.h>
2121
#include <sys/stat.h>
2222
#include <dirent.h>
23-
#include "esp_littlefs.h"
2423
}
25-
24+
#include "sdkconfig.h"
2625
#include "LITTLEFS.h"
2726

27+
#ifdef CONFIG_LITTLEFS_PAGE_SIZE
28+
extern "C" {
29+
#include "esp_littlefs.h"
30+
}
31+
2832
using namespace fs;
2933

3034
class LITTLEFSImpl : public VFSImpl
@@ -137,4 +141,4 @@ size_t LITTLEFSFS::usedBytes()
137141
}
138142

139143
LITTLEFSFS LITTLEFS;
140-
144+
#endif

Diff for: libraries/RainMaker/src/RMaker.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "RMaker.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32
2+
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
33
#include <esp_rmaker_schedule.h>
44
#include <esp_rmaker_utils.h>
55
bool wifiLowLevelInit(bool persistent);

Diff for: libraries/RainMaker/src/RMaker.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "esp_system.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32
2+
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
33

44
#include "Arduino.h"
55
#include "RMakerNode.h"

Diff for: libraries/RainMaker/src/RMakerDevice.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "RMakerDevice.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32
2+
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
33

44
static esp_err_t err;
55
typedef void (*deviceWriteCb)(Device*, Param*, const param_val_t val, void *priv_data, write_ctx_t *ctx);

Diff for: libraries/RainMaker/src/RMakerDevice.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "esp_system.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32
2+
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
33

44
#include "RMakerParam.h"
55
#include <esp_rmaker_standard_devices.h>

Diff for: libraries/RainMaker/src/RMakerNode.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "RMakerNode.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32
2+
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
33
static esp_err_t err;
44

55
esp_err_t Node::addDevice(Device device)

Diff for: libraries/RainMaker/src/RMakerNode.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "esp_system.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32
2+
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
33

44
#include "RMakerDevice.h"
55

Diff for: libraries/RainMaker/src/RMakerParam.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "RMakerParam.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32
2+
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
33

44
static esp_err_t err;
55

Diff for: libraries/RainMaker/src/RMakerParam.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "esp_system.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32
2+
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
33

44
#include "RMakerType.h"
55

Diff for: libraries/RainMaker/src/RMakerQR.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "esp_system.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32
2+
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
33

44
#include <qrcode.h>
55

Diff for: libraries/RainMaker/src/RMakerType.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "RMakerType.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32
2+
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
33

44
param_val_t value(int ival)
55
{

Diff for: libraries/RainMaker/src/RMakerType.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "esp_system.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32
2+
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
33

44
#include <esp_rmaker_core.h>
55
#include <esp_rmaker_ota.h>

Diff for: libraries/RainMaker/src/RMakerUtils.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "esp_system.h"
2-
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32
2+
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
33

44
#include <esp_rmaker_utils.h>
55

Diff for: libraries/WiFiClientSecure/src/ssl_client.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#include "WiFi.h"
2121

2222
#ifndef MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED
23-
# error "Please configure IDF framework to include mbedTLS -> Enable pre-shared-key ciphersuites and activate at least one cipher"
24-
#endif
23+
# warning "Please configure IDF framework to include mbedTLS -> Enable pre-shared-key ciphersuites and activate at least one cipher"
24+
#else
2525

2626
const char *pers = "esp32-tls";
2727

@@ -459,3 +459,5 @@ bool verify_ssl_dn(sslclient_context *ssl_client, const char* domain_name)
459459

460460
return false;
461461
}
462+
#endif
463+

0 commit comments

Comments
 (0)