We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 64e7e46 + 2f792a9 commit 463a453Copy full SHA for 463a453
rtos/ThisThread.cpp
@@ -138,4 +138,13 @@ osThreadId_t ThisThread::get_id()
138
return osThreadGetId();
139
}
140
141
+const char *get_name()
142
+{
143
+ osThreadId_t id = osThreadGetId();
144
+ if (id == NULL) {
145
+ return NULL;
146
+ }
147
+ return osThreadGetName(id);
148
+}
149
+
150
rtos/ThisThread.h
@@ -179,6 +179,12 @@ void yield();
179
*/
180
osThreadId_t get_id();
181
182
+/** Get the thread name of the current running thread.
183
+ @return thread name pointer or NULL if thread has no name or in case of error.
184
+ @note You cannot call this function from ISR context.
185
+*/
186
+const char *get_name();
187
188
};
189
/** @}*/
190
0 commit comments