I have finished a major update to the library, it is more of an extension as the original functionality hasn't changed.
The library now supports in-line atomic operations on any kind of element*
giving you greater control of how long interrupts are held. Some situations may warrant the atomic/critical section to be as short as possible, accessing 'safe' data may be better with short multiple accesses, compared to one long blocking operation. This creates a very easy interface to do so.
For example ( explanations in updated reply #1 )
- Atomic reads.
- Atomic writes.
- Atomic function calls.
- Atomic pointer manipulation.
You can download the new code from the first post [here]
. The documentation has been updated there as well as a full explanation inside the AtomicBlock.h
file. There is more documentation to come, I just wanted to get a quick run down of the new features.
This uses some high level C++ techniques to accomplish safe and efficient operation. If you would like explanations of any parts of the code feel free to ask.*
Object member functions are not currently supported, next update.