From b1261f5471e9aee366c903e8b0d92f23014bb679 Mon Sep 17 00:00:00 2001 From: gojimmypi Date: Thu, 11 Apr 2024 07:46:35 -0700 Subject: [PATCH] Modify PlatformIO FreeRTOS include path, settings.h --- src/internal.c | 7 ++++++- wolfcrypt/benchmark/benchmark.c | 8 +++++++- wolfssl/wolfcrypt/settings.h | 27 +++++++++++++++++++++++++-- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/src/internal.c b/src/internal.c index 5e07570e8..592f21896 100644 --- a/src/internal.c +++ b/src/internal.c @@ -9696,7 +9696,12 @@ ProtocolVersion MakeDTLSv1_3(void) #elif defined(FREERTOS) - #include "task.h" + #ifdef PLATFORMIO + #include + #include + #else + #include "task.h" + #endif unsigned int LowResTimer(void) { diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index 61e51a36e..54a1d8327 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -12801,7 +12801,13 @@ void bench_sphincsKeySign(byte level, byte optim) #elif defined(FREERTOS) - #include "task.h" + #ifdef PLATFORMIO + #include + #include + #else + #include "task.h" + #endif + #if defined(WOLFSSL_ESPIDF) /* prototype definition */ int construct_argv(); diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index d4e30aad9..c06a6ff61 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -265,6 +265,23 @@ /* Uncomment next line if using MAXQ108x */ /* #define WOLFSSL_MAXQ108X */ +/* Check PLATFORMIO first, as it may define other known environments. */ +#ifdef PLATFORMIO + #ifdef ESP_PLATFORM + /* Turn on the wolfSSL ESPIDF flag for the PlatformIO ESP-IDF detect */ + #define WOLFSSL_ESPIDF + #endif /* ESP_PLATFORM */ + + /* Ensure all PlatformIO boards have the wolfSSL user_setting.h enabled. */ + #ifndef WOLFSSL_USER_SETTINGS + #define WOLFSSL_USER_SETTINGS + #endif /* WOLFSSL_USER_SETTINGS */ + + /* Similar to Arduino we have limited build control, so suppress warning */ + #undef WOLFSSL_IGNORE_FILE_WARN + #define WOLFSSL_IGNORE_FILE_WARN +#endif + #if defined(ARDUINO) /* Due to limited build control, we'll ignore file warnings. */ /* See https://github.com/arduino/arduino-cli/issues/631 */ @@ -1034,8 +1051,14 @@ extern void uITRON4_free(void *p) ; #ifdef FREERTOS - #include "FreeRTOS.h" - #include + + #ifdef PLATFORMIO + #include + #include + #else + #include "FreeRTOS.h" + #include + #endif #if !defined(XMALLOC_USER) && !defined(NO_WOLFSSL_MEMORY) && \ !defined(WOLFSSL_STATIC_MEMORY) && !defined(WOLFSSL_TRACK_MEMORY)