diff options
Diffstat (limited to 'runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_F5438_CCS5_HWElevator/etThread.c')
-rw-r--r-- | runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_F5438_CCS5_HWElevator/etThread.c | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_F5438_CCS5_HWElevator/etThread.c b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_F5438_CCS5_HWElevator/etThread.c new file mode 100644 index 000000000..f2a5daf71 --- /dev/null +++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_F5438_CCS5_HWElevator/etThread.c @@ -0,0 +1,72 @@ +/******************************************************************************* + * 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) + * + *******************************************************************************/ + +/** + * + * etThread.c FreeRTOS implementation of etThread + * + */ + +#include "osal/etThread.h" + +#include "debugging/etLogger.h" +#include "debugging/etMSCLogger.h" + +void etThread_execute(etThread* self); + +etThread * noThread; + +void etThread_construct( + etThread* self, + etStacksize stacksize, + etPriority priority, + etThreadname threadName, + etThreadFunction threadFunction, + void* threadFunctionData) +{ + ET_MSC_LOGGER_SYNC_ENTRY("etThread", "construct") + + /* fill in data */ + self->stacksize = stacksize; + self->priority = priority; + self->threadName = threadName; + self->threadFunction = threadFunction; + self->threadFunctionData = threadFunctionData; + // for the single threaded port stacksize and prio is not needed + // save the Threadpointer as singleton + noThread=self; + ET_MSC_LOGGER_SYNC_EXIT +} + +void etThread_start(etThread* self) { + ET_MSC_LOGGER_SYNC_ENTRY("etThread", "start") + ET_MSC_LOGGER_SYNC_EXIT +} + +void etThread_execute(etThread* self){ + ET_MSC_LOGGER_SYNC_ENTRY("etThread", "execute") + /* etThread_execute redirects the call from the thread to the execute function in the eTrice runtime to enable correct synchronous MSC logging */ + self->threadFunction(self->threadFunctionData); + ET_MSC_LOGGER_SYNC_EXIT +} + +void etThread_destruct(etThread* self){ + ET_MSC_LOGGER_SYNC_ENTRY("etThread", "destruct") + + ET_MSC_LOGGER_SYNC_EXIT +} + +void etThread_sleep(etInt32 millis){ + ET_MSC_LOGGER_SYNC_ENTRY("etThread", "sleep") + + ET_MSC_LOGGER_SYNC_EXIT +} |