Skip to content

Commit f9f0732

Browse files
committed
Add Atomic<T> template
Add a C++ `Atomic<T>` template to make atomics even easier. Basically compatible with C++11 `std::atomic<T>`, but using the underlying `core_util_atomic_xxx` functions from mbed_atomic.h, so appropriate for synchronising with interrupts and optimised for uniprocessor. One extra piece of functionality beyond the `core_util_atomic_xxx` functions is the ability to have an arbitrary atomic type - eg a small structure with 2 `uint16_t`s can be stored in a `uint32_t` container.
1 parent 5d2b37d commit f9f0732

File tree

2 files changed

+1237
-1
lines changed

2 files changed

+1237
-1
lines changed

mbed.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
#include "drivers/InterruptIn.h"
8989
#include "platform/mbed_wait_api.h"
9090
#include "hal/sleep_api.h"
91-
#include "platform/mbed_atomic.h"
91+
#include "platform/Atomic.h"
9292
#include "platform/mbed_power_mgmt.h"
9393
#include "platform/mbed_rtc_time.h"
9494
#include "platform/mbed_poll.h"

0 commit comments

Comments
 (0)