- Previously the pulse counter used GCC's built-in functions for atomic memory
access. This PR changes this to use C11 atomics instead:
- Use of C11 atomics instead of atomic build-in functions makes the code
more portable and readable.
- Previously pulse_counter_reset() did not use an atomic function, so that
resets would be racy. (E.g. on the 8-bit AVR platform an 16-bit store is
not atomic, unless special care (like using C11 atomics) is taken.)
This change makes it more clear that the dev is modified in some of the
read functions. Only pulse_counter_read_without_reset gets a const
pointer argument.
Also, use pulse_counter_t pointers instead of void pointers where
possible.