diff options
author | Henrik Rentz-Reichert | 2016-04-18 08:29:12 +0000 |
---|---|---|
committer | Henrik Rentz-Reichert | 2016-04-18 08:30:57 +0000 |
commit | f7e62f7bc4fe98822a874c96befc9d765f40bac0 (patch) | |
tree | 6f1ca52a45954d73853666e395aa67721ace6b2f /runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_XMC_FreeRTOS_Dave/etSema.c | |
parent | dc6cd1b7851886e81d58fb717197f090d0c9959a (diff) | |
download | org.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)
Change-Id: I24ce70a6a5a2f1885e9e8252eb1e0f0df967e585
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.c | 54 |
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 +} |