Fix compilation for use as IDF component (#5265)

This commit is contained in:
Me No Dev 2021-06-09 12:56:12 +03:00 committed by GitHub
parent 90fc68d83f
commit 7f87d0fc3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 29 additions and 21 deletions

View File

@ -170,7 +170,9 @@ if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_ArduinoO
list(APPEND priv_requires esp_https_ota) list(APPEND priv_requires esp_https_ota)
endif() endif()
if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_LITTLEFS) if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_LITTLEFS)
list(APPEND priv_requires esp_littlefs) if(CONFIG_LITTLEFS_PAGE_SIZE)
list(APPEND priv_requires esp_littlefs)
endif()
endif() endif()
idf_component_register(INCLUDE_DIRS ${includedirs} PRIV_INCLUDE_DIRS ${priv_includes} SRCS ${srcs} REQUIRES ${requires} PRIV_REQUIRES ${priv_requires}) idf_component_register(INCLUDE_DIRS ${includedirs} PRIV_INCLUDE_DIRS ${priv_includes} SRCS ${srcs} REQUIRES ${requires} PRIV_REQUIRES ${priv_requires})

View File

@ -18,9 +18,9 @@ For a simplified method, see [lib-builder](lib_builder.md)
cd arduino && \ cd arduino && \
git submodule update --init --recursive && \ git submodule update --init --recursive && \
cd ../.. && \ cd ../.. && \
make menuconfig idf.py menuconfig
``` ```
- ```make menuconfig``` has some Arduino options - ```idf.py menuconfig``` has some Arduino options
- "Autostart Arduino setup and loop on boot" - "Autostart Arduino setup and loop on boot"
- If you enable this options, your main.cpp should be formated like any other sketch - If you enable this options, your main.cpp should be formated like any other sketch
@ -60,7 +60,7 @@ For a simplified method, see [lib-builder](lib_builder.md)
- "Autoconnect WiFi on boot" - "Autoconnect WiFi on boot"
- If enabled, WiFi will start with the last known configuration - If enabled, WiFi will start with the last known configuration
- Else it will wait for WiFi.begin - Else it will wait for WiFi.begin
- ```make flash monitor``` will build, upload and open serial monitor to your board - ```idf.py -p <your-board-serial-port> flash monitor``` will build, upload and open serial monitor to your board
## Logging To Serial ## Logging To Serial

View File

@ -20,11 +20,15 @@ extern "C" {
#include <sys/unistd.h> #include <sys/unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <dirent.h> #include <dirent.h>
#include "esp_littlefs.h"
} }
#include "sdkconfig.h"
#include "LITTLEFS.h" #include "LITTLEFS.h"
#ifdef CONFIG_LITTLEFS_PAGE_SIZE
extern "C" {
#include "esp_littlefs.h"
}
using namespace fs; using namespace fs;
class LITTLEFSImpl : public VFSImpl class LITTLEFSImpl : public VFSImpl
@ -137,4 +141,4 @@ size_t LITTLEFSFS::usedBytes()
} }
LITTLEFSFS LITTLEFS; LITTLEFSFS LITTLEFS;
#endif

View File

@ -1,5 +1,5 @@
#include "RMaker.h" #include "RMaker.h"
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32 #if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
#include <esp_rmaker_schedule.h> #include <esp_rmaker_schedule.h>
#include <esp_rmaker_utils.h> #include <esp_rmaker_utils.h>
bool wifiLowLevelInit(bool persistent); bool wifiLowLevelInit(bool persistent);

View File

@ -1,5 +1,5 @@
#include "esp_system.h" #include "esp_system.h"
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32 #if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
#include "Arduino.h" #include "Arduino.h"
#include "RMakerNode.h" #include "RMakerNode.h"

View File

@ -1,5 +1,5 @@
#include "RMakerDevice.h" #include "RMakerDevice.h"
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32 #if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
static esp_err_t err; static esp_err_t err;
typedef void (*deviceWriteCb)(Device*, Param*, const param_val_t val, void *priv_data, write_ctx_t *ctx); typedef void (*deviceWriteCb)(Device*, Param*, const param_val_t val, void *priv_data, write_ctx_t *ctx);

View File

@ -1,5 +1,5 @@
#include "esp_system.h" #include "esp_system.h"
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32 #if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
#include "RMakerParam.h" #include "RMakerParam.h"
#include <esp_rmaker_standard_devices.h> #include <esp_rmaker_standard_devices.h>

View File

@ -1,5 +1,5 @@
#include "RMakerNode.h" #include "RMakerNode.h"
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32 #if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
static esp_err_t err; static esp_err_t err;
esp_err_t Node::addDevice(Device device) esp_err_t Node::addDevice(Device device)

View File

@ -1,5 +1,5 @@
#include "esp_system.h" #include "esp_system.h"
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32 #if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
#include "RMakerDevice.h" #include "RMakerDevice.h"

View File

@ -1,5 +1,5 @@
#include "RMakerParam.h" #include "RMakerParam.h"
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32 #if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
static esp_err_t err; static esp_err_t err;

View File

@ -1,5 +1,5 @@
#include "esp_system.h" #include "esp_system.h"
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32 #if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
#include "RMakerType.h" #include "RMakerType.h"

View File

@ -1,5 +1,5 @@
#include "esp_system.h" #include "esp_system.h"
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32 #if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
#include <qrcode.h> #include <qrcode.h>

View File

@ -1,5 +1,5 @@
#include "RMakerType.h" #include "RMakerType.h"
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32 #if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
param_val_t value(int ival) param_val_t value(int ival)
{ {

View File

@ -1,5 +1,5 @@
#include "esp_system.h" #include "esp_system.h"
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32 #if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
#include <esp_rmaker_core.h> #include <esp_rmaker_core.h>
#include <esp_rmaker_ota.h> #include <esp_rmaker_ota.h>

View File

@ -1,5 +1,5 @@
#include "esp_system.h" #include "esp_system.h"
#if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_IDF_TARGET_ESP32 #if ESP_IDF_VERSION_MAJOR >= 4 && CONFIG_ESP_RMAKER_TASK_STACK && CONFIG_IDF_TARGET_ESP32
#include <esp_rmaker_utils.h> #include <esp_rmaker_utils.h>

View File

@ -20,8 +20,8 @@
#include "WiFi.h" #include "WiFi.h"
#ifndef MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED #ifndef MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED
# error "Please configure IDF framework to include mbedTLS -> Enable pre-shared-key ciphersuites and activate at least one cipher" # warning "Please configure IDF framework to include mbedTLS -> Enable pre-shared-key ciphersuites and activate at least one cipher"
#endif #else
const char *pers = "esp32-tls"; const char *pers = "esp32-tls";
@ -459,3 +459,5 @@ bool verify_ssl_dn(sslclient_context *ssl_client, const char* domain_name)
return false; return false;
} }
#endif