Skip to content

Commit 340a244

Browse files
committed
Restore tabname->threadname functionality
1 parent bf3034e commit 340a244

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Arduino_Threads.h

+9-4
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,19 @@ class ArduinoThreads {
7474
}
7575
}
7676
rtos::Thread *t;
77+
78+
protected:
79+
char* _tabname;
80+
7781
public:
7882
// start this sketch
7983
void start(int stacksize = 4096, uint32_t startFlags=0, uint32_t stopFlags=0) {
8084
this->startFlags = startFlags;
8185
this->stopFlags = stopFlags;
8286
loopDelay=0;
83-
t = new rtos::Thread(osPriorityNormal, stacksize, nullptr, _macroToString(tabname));
84-
t->start(mbed::callback(this, &ArduinoThreads::execute));
85-
}
87+
t = new rtos::Thread(osPriorityNormal, stacksize, nullptr, _tabname);
88+
t->start(mbed::callback(this, &ArduinoThreads::execute));
89+
}
8690
// kill this sketch
8791
void terminate() {
8892
t->terminate();
@@ -104,7 +108,8 @@ class ArduinoThreads {
104108
rtos::EventFlags ArduinoThreads::globalEvents;
105109

106110
#define THD_ENTER(tabname) class CONCAT(tabname, Class) : public ArduinoThreads { \
107-
private:
111+
public: \
112+
CONCAT(tabname, Class)() { _tabname = _macroToString(tabname); }
108113

109114
#define THD_DONE(tabname) \
110115
}; \

0 commit comments

Comments
 (0)