Skip to content

Commit 63553a8

Browse files
committed
Provide a macro for instantiation of a Shared variable.
1 parent 7bfd800 commit 63553a8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Shared<int> counter;
1+
SHARED(counter, int);

src/Arduino_Threads.h

+3
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ public: \
5353
// This is called "C++11 uniform init" (using "{}" instead of "()" without "="... yikes!)
5454
// https://chromium.googlesource.com/chromium/src/+/master/styleguide/c++/c++-dos-and-donts.md
5555

56+
#define SHARED(name, type) \
57+
Shared<type> name;
58+
5659
/**************************************************************************************
5760
* CLASS DECLARATION
5861
**************************************************************************************/

0 commit comments

Comments
 (0)