I have a library running on AVR platforms where I have to access volatile data that could be modified by ISR. To make sure that I'm not accessing a multibyte variable while the ISR is by modifying it, I have the following…
#include<util/atomic.h>
And then later in the code I use the ATOMIC_BLOCK macro to ensure atomic access. Is there such an equivalent system for Arduino Zero or other SAMD 21 based boards?