Skip to content

Commit 7f87d0f

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

File tree

16 files changed

+29
-21
lines changed

16 files changed

+29
-21
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
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})

docs/esp-idf_component.md

Lines changed: 3 additions & 3 deletions
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

libraries/LITTLEFS/src/LITTLEFS.cpp

Lines changed: 7 additions & 3 deletions
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

libraries/RainMaker/src/RMaker.cpp

Lines changed: 1 addition & 1 deletion
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);

libraries/RainMaker/src/RMaker.h

Lines changed: 1 addition & 1 deletion
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"

libraries/RainMaker/src/RMakerDevice.cpp

Lines changed: 1 addition & 1 deletion
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);

libraries/RainMaker/src/RMakerDevice.h

Lines changed: 1 addition & 1 deletion
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>

libraries/RainMaker/src/RMakerNode.cpp

Lines changed: 1 addition & 1 deletion
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)

libraries/RainMaker/src/RMakerNode.h

Lines changed: 1 addition & 1 deletion
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

libraries/RainMaker/src/RMakerParam.cpp

Lines changed: 1 addition & 1 deletion
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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy