Skip to content

Commit 87f7c11

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 5914b81 commit 87f7c11

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
@@ -86,7 +86,7 @@
8686
#include "drivers/InterruptIn.h"
8787
#include "platform/mbed_wait_api.h"
8888
#include "hal/sleep_api.h"
89-
#include "platform/mbed_atomic.h"
89+
#include "platform/Atomic.h"
9090
#include "platform/mbed_power_mgmt.h"
9191
#include "platform/mbed_rtc_time.h"
9292
#include "platform/mbed_poll.h"

0 commit comments

Comments
 (0)