Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2016-04-18 08:29:12 +0000
committerHenrik Rentz-Reichert2016-04-18 08:30:57 +0000
commitf7e62f7bc4fe98822a874c96befc9d765f40bac0 (patch)
tree6f1ca52a45954d73853666e395aa67721ace6b2f /runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_XMC_FreeRTOS_Dave/etMutex.c
parentdc6cd1b7851886e81d58fb717197f090d0c9959a (diff)
downloadorg.eclipse.etrice-f7e62f7bc4fe98822a874c96befc9d765f40bac0.tar.gz
org.eclipse.etrice-f7e62f7bc4fe98822a874c96befc9d765f40bac0.tar.xz
org.eclipse.etrice-f7e62f7bc4fe98822a874c96befc9d765f40bac0.zip
added new runtimes for Dave (on behalf of Thomas Jung)
Diffstat (limited to 'runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_XMC_FreeRTOS_Dave/etMutex.c')
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_XMC_FreeRTOS_Dave/etMutex.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_XMC_FreeRTOS_Dave/etMutex.c b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_XMC_FreeRTOS_Dave/etMutex.c
new file mode 100644
index 000000000..7d473ce3e
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_XMC_FreeRTOS_Dave/etMutex.c
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2013 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Thomas Jung (initial contribution)
+ *
+ *******************************************************************************/
+
+/**
+ *
+ * etMutex.c FreeRTOS implementation of etMutex
+ *
+ */
+
+#include "osal/etMutex.h"
+
+#include "debugging/etLogger.h"
+#include "debugging/etMSCLogger.h"
+
+void etMutex_construct(etMutex* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMutex", "construct")
+ self->osData = xSemaphoreCreateMutex();
+ if((self->osData) == NULL){
+ while(1){};
+ }
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+void etMutex_destruct(etMutex* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMutex", "destruct")
+ vSemaphoreDelete( self->osData );
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+void etMutex_enter(etMutex* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMutex", "enter")
+ xSemaphoreTake(self->osData,portMAX_DELAY );
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+void etMutex_leave(etMutex* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMutex", "leave")
+ xSemaphoreGive(self->osData);
+ ET_MSC_LOGGER_SYNC_EXIT
+}

Back to the top