diff --git a/cores/common/arduino/libraries/api/WiFi/WiFiGeneric.cpp b/cores/common/arduino/libraries/api/WiFi/WiFiGeneric.cpp index 2621f5d..bfac01a 100644 --- a/cores/common/arduino/libraries/api/WiFi/WiFiGeneric.cpp +++ b/cores/common/arduino/libraries/api/WiFi/WiFiGeneric.cpp @@ -2,6 +2,10 @@ #include "WiFi.h" +#if LT_HAS_FREERTOS +#include +#endif + bool WiFiClass::mode(WiFiMode mode) { // store a pointer to WiFi for WiFiEvents.cpp pWiFi = this; diff --git a/cores/common/arduino/libraries/common/WiFiClient/MbedTLSClient.cpp b/cores/common/arduino/libraries/common/WiFiClient/MbedTLSClient.cpp index ecc67c4..65a8c1d 100644 --- a/cores/common/arduino/libraries/common/WiFiClient/MbedTLSClient.cpp +++ b/cores/common/arduino/libraries/common/WiFiClient/MbedTLSClient.cpp @@ -15,6 +15,10 @@ extern "C" { #include #include +#if LT_HAS_FREERTOS +#include +#endif + } // extern "C" #define _clientKeyC ((mbedtls_pk_context *)_clientKey) diff --git a/cores/common/arduino/src/wiring_compat.cpp b/cores/common/arduino/src/wiring_compat.cpp index 67469cc..72549b3 100644 --- a/cores/common/arduino/src/wiring_compat.cpp +++ b/cores/common/arduino/src/wiring_compat.cpp @@ -2,36 +2,6 @@ #include "wiring_compat.h" -#if LT_HAS_FREERTOS -BaseType_t xTaskCreateUniversal( - TaskFunction_t pxTaskCode, - const char *const pcName, - const uint32_t usStackDepth, - void *const pvParameters, - UBaseType_t uxPriority, - TaskHandle_t *const pxCreatedTask, - const BaseType_t xCoreID -) { - // #ifndef CONFIG_FREERTOS_UNICORE - // if (xCoreID >= 0 && xCoreID < 2) { - // return xTaskCreatePinnedToCore( - // pxTaskCode, - // pcName, - // usStackDepth, - // pvParameters, - // uxPriority, - // pxCreatedTask, - // xCoreID - // ); - // } else { - // #endif - return xTaskCreate(pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask); - // #ifndef CONFIG_FREERTOS_UNICORE - // } - // #endif -} -#endif - String ipToString(const IPAddress &ip) { char szRet[16]; sprintf(szRet, "%hhu.%hhu.%hhu.%hhu", ip[0], ip[1], ip[2], ip[3]); diff --git a/cores/common/arduino/src/wiring_compat.h b/cores/common/arduino/src/wiring_compat.h index 622452d..811c6de 100644 --- a/cores/common/arduino/src/wiring_compat.h +++ b/cores/common/arduino/src/wiring_compat.h @@ -8,14 +8,6 @@ extern "C" { #endif // __cplusplus -#if LT_HAS_FREERTOS -// dirty hack to avoid including BDK's arch.h (from FreeRTOS/portable.h) -#define _ARCH_H_ -#include -#include -#undef _ARCH_H_ -#endif - // Definitions for error constants. #define esp_err_t int #define ESP_OK 0 /*!< esp_err_t value indicating success (no error) */ @@ -34,20 +26,9 @@ extern "C" { #define digitalPinToInterrupt(pin) (pin) // FreeRTOS utilities -#if LT_HAS_FREERTOS -// if xCoreID < 0 or CPU is unicore, it will use xTaskCreate, else xTaskCreatePinnedToCore -// allows to easily handle all possible situations without repetitive code -BaseType_t xTaskCreateUniversal( - TaskFunction_t pxTaskCode, - const char *const pcName, - const uint32_t usStackDepth, - void *const pvParameters, - UBaseType_t uxPriority, - TaskHandle_t *const pxCreatedTask, - const BaseType_t xCoreID -); +#define xTaskCreateUniversal(pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask, xCoreID) \ + xTaskCreate(pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask) #define xTaskCreatePinnedToCore xTaskCreateUniversal -#endif // Default values from sdkconfig.h #define CONFIG_LWIP_MAX_ACTIVE_TCP 16 diff --git a/cores/common/arduino/src/wiring_custom.c b/cores/common/arduino/src/wiring_custom.c index 0ca036e..050a87f 100644 --- a/cores/common/arduino/src/wiring_custom.c +++ b/cores/common/arduino/src/wiring_custom.c @@ -2,6 +2,10 @@ #include "wiring_custom.h" +#if LT_HAS_FREERTOS +#include +#endif + int _analogReadResolution = 10; // 0-1023 int _analogWriteResolution = 8; // 0-255 int _analogWritePeriod = 20000; // 50 Hz diff --git a/cores/common/base/lt_logger.h b/cores/common/base/lt_logger.h index 14abf69..7948c52 100644 --- a/cores/common/base/lt_logger.h +++ b/cores/common/base/lt_logger.h @@ -93,7 +93,7 @@ void lt_log_disable(); #define LT_FM(...) #endif -#if LT_LOG_HEAP +#if LT_LOG_HEAP && LT_HAS_FREERTOS #define LT_HEAP_I() LT_I("Free heap: %u", LT_HEAP_FUNC()); #else #define LT_HEAP_I()