aboutsummaryrefslogtreecommitdiffstats
path: root/os/common/ports/ARMCMx
diff options
context:
space:
mode:
Diffstat (limited to 'os/common/ports/ARMCMx')
-rw-r--r--os/common/ports/ARMCMx/cmsis_os/cmsis_os.c1
-rw-r--r--os/common/ports/ARMCMx/cmsis_os/cmsis_os.h14
2 files changed, 9 insertions, 6 deletions
diff --git a/os/common/ports/ARMCMx/cmsis_os/cmsis_os.c b/os/common/ports/ARMCMx/cmsis_os/cmsis_os.c
index 6b328ea7f..04bebeb1d 100644
--- a/os/common/ports/ARMCMx/cmsis_os/cmsis_os.c
+++ b/os/common/ports/ARMCMx/cmsis_os/cmsis_os.c
@@ -119,6 +119,7 @@ osThreadId osThreadCreate(const osThreadDef_t *thread_def, void *argument) {
thread_def->stacksize;
return (osThreadId)chThdCreateFromHeap(0,
THD_WORKING_AREA_SIZE(size),
+ thread_def->name,
NORMALPRIO+thread_def->tpriority,
(tfunc_t)thread_def->pthread,
argument);
diff --git a/os/common/ports/ARMCMx/cmsis_os/cmsis_os.h b/os/common/ports/ARMCMx/cmsis_os/cmsis_os.h
index 41d96baed..1c0998baf 100644
--- a/os/common/ports/ARMCMx/cmsis_os/cmsis_os.h
+++ b/os/common/ports/ARMCMx/cmsis_os/cmsis_os.h
@@ -243,6 +243,7 @@ typedef struct os_thread_def {
os_pthread pthread;
osPriority tpriority;
uint32_t stacksize;
+ const char *name;
} osThreadDef_t;
/**
@@ -301,14 +302,15 @@ typedef struct os_messageQ_def {
* @brief Create a Thread definition.
*/
#if defined(osObjectsExternal)
-#define osThreadDef(name, priority, instances, stacksz) \
- extern const osThreadDef_t os_thread_def_##name
+#define osThreadDef(thd, priority, stacksz, name) \
+ extern const osThreadDef_t os_thread_def_##thd
#else
-#define osThreadDef(name, priority, stacksz) \
-const osThreadDef_t os_thread_def_##name = { \
- (name), \
+#define osThreadDef(thd, priority, stacksz, name) \
+const osThreadDef_t os_thread_def_##thd = { \
+ (thd), \
(priority), \
- (stacksz) \
+ (stacksz), \
+ (name) \
}
#endif