ruuvi.drivers.c ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
Loading...
Searching...
No Matches
ruuvi_nrf5_sdk15_atomic.c
Go to the documentation of this file.
3#if RUUVI_NRF5_SDK15_ATOMIC_ENABLED
4#include "nrf_atomic.h"
5
6bool ri_atomic_flag (ri_atomic_t * const flag, const bool set)
7{
8 uint32_t expected = !set;
9 return nrf_atomic_u32_cmp_exch (flag, &expected, set);
10}
11
12#endif
Header to enable and disable module compilation.
bool ri_atomic_flag(ri_atomic_t *const flag, const bool set)
Atomic flag check and set/clear function.
volatile uint32_t ri_atomic_t
define atomic type - not portable to 8-bit.