Search code examples
catomic

Passing uint8_t to atomic_clr


I get a compiler error when passing a uint8_t to atomic_clr. The error is: "passing argument 1 from incompatible pointer type".

Why is that?


Solution

  • Should be pointer to volatile unsigned

    #include <atomic.h>
    
    void atomic_clr( volatile unsigned * loc,
                     unsigned bits );