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.
2 parents 5f36041 + 6aca51f commit 5be51a5Copy full SHA for 5be51a5
platform/mbed_wait_api_no_rtos.c
@@ -23,16 +23,23 @@
23
// if the RTOS is not present.
24
#ifndef MBED_CONF_RTOS_PRESENT
25
26
+#include "hal/lp_ticker_api.h"
27
#include "hal/us_ticker_api.h"
28
29
void wait(float s)
30
{
- wait_us(s * 1000000.0f);
31
+ wait_ms(s * 1000.0f);
32
}
33
34
void wait_ms(int ms)
35
36
+#if DEVICE_LPTICKER
37
+ const ticker_data_t *const ticker = get_lp_ticker_data();
38
+ uint32_t start = ticker_read(ticker);
39
+ while ((ticker_read(ticker) - start) < (uint32_t)(ms * 1000));
40
+#else
41
wait_us(ms * 1000);
42
+#endif
43
44
45
void wait_us(int us)
0 commit comments