From 9069707519561ca8136d58c0f18fb176c9050a1d Mon Sep 17 00:00:00 2001 From: Jason Carroll Date: Mon, 7 Nov 2022 11:54:48 -0800 Subject: [PATCH] Fix coreSNTP demo not setting alt threading functions for mbedtls. --- FreeRTOS-Plus/Demo/coreSNTP_Windows_Simulator/main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/FreeRTOS-Plus/Demo/coreSNTP_Windows_Simulator/main.c b/FreeRTOS-Plus/Demo/coreSNTP_Windows_Simulator/main.c index a9a8b045c7..af4cb5429e 100644 --- a/FreeRTOS-Plus/Demo/coreSNTP_Windows_Simulator/main.c +++ b/FreeRTOS-Plus/Demo/coreSNTP_Windows_Simulator/main.c @@ -50,7 +50,10 @@ /* mbedTLS include for configuring * threading functions. */ #include "mbedtls/threading.h" -#include "threading_alt.h" +#include "mbedtls/build_info.h" +#ifdef MBEDTLS_THREADING_ALT + #include "threading_alt.h" +#endif /* MBEDTLS_THREADING_ALT */ /* Demo Specific configs. */ #include "demo_config.h" @@ -155,6 +158,10 @@ void vStartSntpDemo( void ) { initializeSystemClock(); + #ifdef MBEDTLS_THREADING_ALT + mbedtls_platform_threading_init(); + #endif /* MBEDTLS_THREADING_ALT */ + /* Create the SNTP client task that is responsible for synchronizing system time with the time servers * periodically. This is created as a high priority task to keep the SNTP client operation unhindered. */ xTaskCreate( sntpTask, /* Function that implements the task. */ @@ -166,7 +173,7 @@ void vStartSntpDemo( void ) /* Create the task that represents an application needing wall-clock time. */ xTaskCreate( sampleAppTask, /* Function that implements the task. */ - "SampleAppTask", /* Text name for the task - only used for debugging. */ + "SampleAppTask", /* Text name for the task - only used for debugging. */ democonfigDEMO_STACKSIZE, /* Size of stack (in words, not bytes) to allocate for the task. */ NULL, /* Task parameter - not used in this case. */ tskIDLE_PRIORITY, /* Task priority, must be between 0 and configMAX_PRIORITIES - 1. */