- /* Win32 */\r
- *sobj = CreateMutex(NULL, FALSE, NULL);\r
- return (int)(*sobj != INVALID_HANDLE_VALUE);\r
-\r
- /* uITRON */\r
-// T_CSEM csem = {TA_TPRI,1,1};\r
-// *sobj = acre_sem(&csem);\r
-// return (int)(*sobj > 0);\r
-\r
- /* uC/OS-II */\r
-// OS_ERR err;\r
-// *sobj = OSMutexCreate(0, &err);\r
-// return (int)(err == OS_NO_ERR);\r
-\r
- /* FreeRTOS */\r
-// *sobj = xSemaphoreCreateMutex();\r
-// return (int)(*sobj != NULL);\r
-\r
- /* CMSIS-RTOS */\r
-// *sobj = osMutexCreate(Mutex + vol);\r
-// return (int)(*sobj != NULL);\r
+#if OS_TYPE == 0 /* Win32 */\r
+ Mutex[vol] = CreateMutex(NULL, FALSE, NULL);\r
+ return (int)(Mutex[vol] != INVALID_HANDLE_VALUE);\r
+\r
+#elif OS_TYPE == 1 /* uITRON */\r
+ T_CMTX cmtx = {TA_TPRI,1};\r
+\r
+ Mutex[vol] = acre_mtx(&cmtx);\r
+ return (int)(Mutex[vol] > 0);\r
+\r
+#elif OS_TYPE == 2 /* uC/OS-II */\r
+ OS_ERR err;\r
+\r
+ Mutex[vol] = OSMutexCreate(0, &err);\r
+ return (int)(err == OS_NO_ERR);\r
+\r
+#elif OS_TYPE == 3 /* FreeRTOS */\r
+ Mutex[vol] = xSemaphoreCreateMutex();\r
+ return (int)(Mutex[vol] != NULL);\r
+\r
+#elif OS_TYPE == 4 /* CMSIS-RTOS */\r
+ osMutexDef(cmsis_os_mutex);\r
+\r
+ Mutex[vol] = osMutexCreate(osMutex(cmsis_os_mutex));\r
+ return (int)(Mutex[vol] != NULL);\r
+\r
+#endif\r