Skip to content

Commit 19fbfe9

Browse files
committed
Fix compilation error and access source/sinks via scope-resolution operator.
1 parent 5f4a0c0 commit 19fbfe9

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

Diff for: examples/Threading_Basics/Source_Sink_Counter/Source_Sink_Counter.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
void setup()
77
{
8-
Producer.counter.connectTo(Consumer.counter);
8+
ProducerPrivate::counter.connectTo(ConsumerPrivate::counter);
99
Producer.start();
1010
Consumer.start();
1111
}

Diff for: examples/Threading_Basics/Source_Sink_LED/Source_Sink_LED.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
void setup()
77
{
8-
Source_Thread.led.connectTo(Sink_Thread.led);
8+
Source_ThreadPrivate::led.connectTo(Sink_ThreadPrivate::led);
99
Sink_Thread.start();
1010
Source_Thread.start();
1111
}

Diff for: src/Arduino_Threads.h

+5-13
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@
4141
**************************************************************************************/
4242

4343
#define SOURCE(name, type) \
44-
public: \
45-
Source<type> name; \
46-
private:
44+
Source<type> name;
4745

4846
/* We need to call the SinkBlocking<T>(size_t const size)
4947
* non-default constructor using size as parameter.
@@ -61,14 +59,10 @@ public: \
6159
*/
6260

6361
#define SINK_2_ARG(name, type) \
64-
public: \
65-
SinkBlocking<type> name{1}; \
66-
private:
62+
SinkBlocking<type> name{1}
6763

6864
#define SINK_3_ARG(name, type, size) \
69-
public: \
70-
SinkBlocking<type> name{size}; \
71-
private:
65+
SinkBlocking<type> name{size}
7266

7367
/* Black C macro magic enabling "macro overloading"
7468
* with same name macro, but multiple arguments.
@@ -78,12 +72,10 @@ public: \
7872
#define SINK(...) GET_SINK_MACRO(__VA_ARGS__, SINK_3_ARG, SINK_2_ARG)(__VA_ARGS__)
7973

8074
#define SINK_NON_BLOCKING(name, type) \
81-
public: \
82-
SinkNonBlocking<type> name{}; \
83-
private:
75+
SinkNonBlocking<type> name{}
8476

8577
#define SHARED(name, type) \
86-
Shared<type> name;
78+
Shared<type> name
8779

8880
#define ARDUINO_THREADS_CONCAT_(x,y) x##y
8981
#define ARDUINO_THREADS_CONCAT(x,y) ARDUINO_THREADS_CONCAT_(x,y)

0 commit comments

Comments
 (0)