test
Fork of mbed-dev by
Diff: platform/mbed_wait_api_no_rtos.c
- Revision:
- 176:af195413fb11
- Parent:
- 160:d5399cc887bb
--- a/platform/mbed_wait_api_no_rtos.c Mon Oct 02 15:33:19 2017 +0100 +++ b/platform/mbed_wait_api_no_rtos.c Wed Oct 11 12:45:49 2017 +0100 @@ -30,8 +30,9 @@ } void wait_us(int us) { - uint32_t start = us_ticker_read(); - while ((us_ticker_read() - start) < (uint32_t)us); + const ticker_data_t *const ticker = get_us_ticker_data(); + uint32_t start = ticker_read(ticker); + while ((ticker_read(ticker) - start) < (uint32_t)us); } #endif // #ifndef MBED_CONF_RTOS_PRESENT