From e16f59a2ee138f03b86ab1a3faa19f12ca320b8f Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Mon, 14 Jun 2021 14:06:35 +0100 Subject: [PATCH] timing_mbed.cpp: Check MBEDTLS_TIMING_ALT Do not compile the Mbed implementation of Mbed TLS unless MBEDTLS_TIMING_ALT is defined. This prevents a macro check error on devices that do not have LPTICKER or USTICKER when Mbed TLS timing is not enabled. --- connectivity/mbedtls/platform/src/timing_mbed.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/connectivity/mbedtls/platform/src/timing_mbed.cpp b/connectivity/mbedtls/platform/src/timing_mbed.cpp index 0ba81aa8e1..17acf6c9b9 100644 --- a/connectivity/mbedtls/platform/src/timing_mbed.cpp +++ b/connectivity/mbedtls/platform/src/timing_mbed.cpp @@ -24,6 +24,9 @@ #else #include MBEDTLS_CONFIG_FILE #endif + +#if defined(MBEDTLS_TIMING_ALT) + #include "mbedtls/timing.h" #include "drivers/Timeout.h" #include "drivers/Timer.h" @@ -130,3 +133,5 @@ extern "C" int mbedtls_timing_get_delay(void *data) return 0; } + +#endif // MBEDTLS_TIMING_ALT