COSA
An Object-Oriented Platform for Arduino Programming
Lock.hh
Go to the documentation of this file.
1 
21 #ifndef COSA_LOCK_HH
22 #define COSA_LOCK_HH
23 
24 #include "Cosa/Types.h"
25 
40 class Lock {
41 public:
46  Lock()
47  {
48  m_key = SREG;
49  __asm__ __volatile__("cli" ::: "memory");
50  }
51 
56  {
57  SREG = m_key;
58  __asm__ __volatile__("" ::: "memory");
59  }
60 
61 private:
63  uint8_t m_key;
64 };
65 #endif
66 
~Lock()
Definition: Lock.hh:55
Definition: Lock.hh:40
Lock()
Definition: Lock.hh:46