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/etSema.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/etSema.c')
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_XMC_FreeRTOS_Dave/etSema.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_XMC_FreeRTOS_Dave/etSema.c b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_XMC_FreeRTOS_Dave/etSema.c
new file mode 100644
index 000000000..c01b28724
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_XMC_FreeRTOS_Dave/etSema.c
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * 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 Schuetz, Thomas Jung (initial contribution)
+ *
+ *******************************************************************************/
+
+/**
+ *
+ * etSema.c FreeRTOS implementation of etSema
+ *
+ */
+
+#include "osal/etSema.h"
+
+#include "debugging/etMSCLogger.h"
+
+
+void etSema_construct(etSema* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etSema", "construct")
+ self->osData = xSemaphoreCreateCounting( 1, 0 );
+ if ((self->osData) == NULL){
+ while(1){};
+ }
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+void etSema_destruct(etSema* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etSema", "destruct")
+ vSemaphoreDelete( self->osData );
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+void etSema_wakeup(etSema* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etSema", "wakeup")
+ xSemaphoreGive( self->osData );
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+void etSema_wakeupFromISR(etSema* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etSema", "wakeupFromISR")
+ xSemaphoreGiveFromISR( self->osData, NULL );
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+void etSema_waitForWakeup(etSema* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etSema", "waitForWakeup")
+ xSemaphoreTake(self->osData, portMAX_DELAY );
+ ET_MSC_LOGGER_SYNC_EXIT
+}

Back to the top