mbed library sources. Supersedes mbed-src.
Dependents: Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more
Diff: hal/mbed_ticker_api.c
- Revision:
- 189:f392fc9709a3
- Parent:
- 188:bcfe06ba3d64
--- a/hal/mbed_ticker_api.c Thu Nov 08 11:46:34 2018 +0000 +++ b/hal/mbed_ticker_api.c Wed Feb 20 22:31:08 2019 +0000 @@ -1,5 +1,6 @@ /* mbed Microcontroller Library * Copyright (c) 2015 ARM Limited + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -415,13 +416,16 @@ us_timestamp_t ticker_read_us(const ticker_data_t *const ticker) { + us_timestamp_t ret; + initialize(ticker); core_util_critical_section_enter(); update_present_time(ticker); + ret = ticker->queue->present_time; core_util_critical_section_exit(); - return ticker->queue->present_time; + return ret; } int ticker_get_next_timestamp(const ticker_data_t *const data, timestamp_t *timestamp)