We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e16f59a commit ca719a9Copy full SHA for ca719a9
connectivity/mbedtls/platform/src/timing_mbed.cpp
@@ -29,6 +29,7 @@
29
30
#include "mbedtls/timing.h"
31
#include "drivers/Timeout.h"
32
+#include "drivers/LowPowerTimeout.h"
33
#include "drivers/Timer.h"
34
#include "drivers/LowPowerTimer.h"
35
#include <chrono>
@@ -44,7 +45,14 @@ static void handle_alarm(void)
44
45
46
extern "C" void mbedtls_set_alarm(int seconds)
47
{
48
+#if DEVICE_LPTICKER
49
+ static mbed::LowPowerTimeout t;
50
+#elif DEVICE_USTICKER
51
static mbed::Timeout t;
52
+#else
53
+#error "MBEDTLS_TIMING_C requires either LPTICKER or USTICKER"
54
+#endif
55
+
56
mbedtls_timing_alarmed = 0;
57
58
t.attach(handle_alarm, std::chrono::seconds(seconds));
0 commit comments