Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/org.eclipse.etrice.runtime.c/src')
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.h96
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etMSCLogger.c114
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etMSCLogger.h112
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c668
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h138
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessage.c50
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessage.h52
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.c198
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.h90
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageReceiver.h46
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageService.c206
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageService.h100
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etActor.c36
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etActor.h48
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etPort.c71
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etPort.h124
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/platform/etMemory.h29
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/platform/etPlatform.h54
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etDatatypes.h144
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etGlobalFlags.h44
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etLogger.c156
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etPlatform.c166
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/info.txt2
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etDatatypes.h146
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etGlobalFlags.h46
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etLogger.c140
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etPlatform.c52
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/info.txt4
28 files changed, 1587 insertions, 1545 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.h b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.h
index b353e6f1a..6c46889a8 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.h
@@ -1,48 +1,48 @@
-/*******************************************************************************
- * Copyright (c) 2011 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 (initial contribution)
- *
- *******************************************************************************/
-
-/*
- * etLogger.h
- *
- * Created on: 16.01.2012
- * Author: tschuetz
- */
-
-#ifndef _ETLOGGER_H_
-#define _ETLOGGER_H_
-
-#include <stdio.h>
-#include "etDatatypes.h"
-/* logging */
-
-void etLogger_logError(const char* message);
-
-void etLogger_logWarning(const char* message);
-
-void etLogger_logInfo(const char* message);
-
-void etLogger_logErrorF(const char* format, ... );
-
-void etLogger_logWarningF(const char* format, ... );
-
-void etLogger_logInfoF(const char* format, ... );
-
-
-/* File handling */
-
-etFileHandle etLogger_fopen(const char* filename, const char* mode);
-
-int etLogger_fclose(etFileHandle file);
-
-void etLogger_fprintf(etFileHandle file, const char* format, ... );
-
-#endif /* _ETLOGGER_H_ */
+/*******************************************************************************
+ * Copyright (c) 2011 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+/*
+ * etLogger.h
+ *
+ * Created on: 16.01.2012
+ * Author: tschuetz
+ */
+
+#ifndef _ETLOGGER_H_
+#define _ETLOGGER_H_
+
+#include <stdio.h>
+#include "etDatatypes.h"
+/* logging */
+
+void etLogger_logError(const char* message);
+
+void etLogger_logWarning(const char* message);
+
+void etLogger_logInfo(const char* message);
+
+void etLogger_logErrorF(const char* format, ... );
+
+void etLogger_logWarningF(const char* format, ... );
+
+void etLogger_logInfoF(const char* format, ... );
+
+
+/* File handling */
+
+etFileHandle etLogger_fopen(const char* filename, const char* mode);
+
+int etLogger_fclose(etFileHandle file);
+
+void etLogger_fprintf(etFileHandle file, const char* format, ... );
+
+#endif /* _ETLOGGER_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etMSCLogger.c b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etMSCLogger.c
index fee947eab..4596292a7 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etMSCLogger.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etMSCLogger.c
@@ -1,57 +1,57 @@
-/*******************************************************************************
- * Copyright (c) 2012 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 (initial contribution)
- *
- *******************************************************************************/
-
-#include "debugging/etMSCLogger.h"
-
-#include "debugging/etLogger.h"
-
-static etFileHandle etMSCLogger_fileHandle = NULL;
-static char* etMSCLogger_objectName = "";
-
-#define ET_MAX_FILENAME_LEN 256
-
-void etMSCLogger_open(char* logPath, char* mscName){
- char path[ET_MAX_FILENAME_LEN];
- sprintf(path, "%s/%s.seq", logPath, mscName);
- etMSCLogger_fileHandle = etLogger_fopen(path, "w+");
-}
-
-void etMSCLogger_close(void){
- if (etMSCLogger_fileHandle != NULL){
- etLogger_fclose(etMSCLogger_fileHandle);
- }
-
-}
-
-void etMSCLogger_setObjectName(char* objectName){
- etMSCLogger_objectName = objectName;
-}
-
-char* etMSCLogger_getObjectName(void){
- return etMSCLogger_objectName;
-}
-
-void etMSCLogger_syncCall(char* sourceName, char* messageName, char* targetName){
- etLogger_fprintf(etMSCLogger_fileHandle, "%s ==> %s %s\n", sourceName, targetName, messageName);
-}
-
-void etMSCLogger_syncReturn(char* sourceName, char* targetName){
- etLogger_fprintf(etMSCLogger_fileHandle, "%s <== %s\n", sourceName, targetName);
-}
-
-void etMSCLogger_asyncOut(char* sourceName, char* messageName, char* targetName){
- etLogger_fprintf(etMSCLogger_fileHandle, "%s >-- %s %s\n", sourceName, targetName, messageName);
-}
-
-void etMSCLogger_asyncIn(char* sourceName, char* messageName, char* targetName){
- etLogger_fprintf(etMSCLogger_fileHandle, "%s --> %s %s\n", sourceName, targetName, messageName);
-}
+/*******************************************************************************
+ * Copyright (c) 2012 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+#include "debugging/etMSCLogger.h"
+
+#include "debugging/etLogger.h"
+
+static etFileHandle etMSCLogger_fileHandle = NULL;
+static char* etMSCLogger_objectName = "";
+
+#define ET_MAX_FILENAME_LEN 256
+
+void etMSCLogger_open(char* logPath, char* mscName){
+ char path[ET_MAX_FILENAME_LEN];
+ sprintf(path, "%s/%s.seq", logPath, mscName);
+ etMSCLogger_fileHandle = etLogger_fopen(path, "w+");
+}
+
+void etMSCLogger_close(void){
+ if (etMSCLogger_fileHandle != NULL){
+ etLogger_fclose(etMSCLogger_fileHandle);
+ }
+
+}
+
+void etMSCLogger_setObjectName(char* objectName){
+ etMSCLogger_objectName = objectName;
+}
+
+char* etMSCLogger_getObjectName(void){
+ return etMSCLogger_objectName;
+}
+
+void etMSCLogger_syncCall(char* sourceName, char* messageName, char* targetName){
+ etLogger_fprintf(etMSCLogger_fileHandle, "%s ==> %s %s\n", sourceName, targetName, messageName);
+}
+
+void etMSCLogger_syncReturn(char* sourceName, char* targetName){
+ etLogger_fprintf(etMSCLogger_fileHandle, "%s <== %s\n", sourceName, targetName);
+}
+
+void etMSCLogger_asyncOut(char* sourceName, char* messageName, char* targetName){
+ etLogger_fprintf(etMSCLogger_fileHandle, "%s >-- %s %s\n", sourceName, targetName, messageName);
+}
+
+void etMSCLogger_asyncIn(char* sourceName, char* messageName, char* targetName){
+ etLogger_fprintf(etMSCLogger_fileHandle, "%s --> %s %s\n", sourceName, targetName, messageName);
+}
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etMSCLogger.h b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etMSCLogger.h
index 1d3ec868f..b1720cec5 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etMSCLogger.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etMSCLogger.h
@@ -1,56 +1,56 @@
-/*******************************************************************************
- * Copyright (c) 2012 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 (initial contribution)
- *
- *******************************************************************************/
-
-#ifndef _ETMSCLOGGER_H_
-#define _ETMSCLOGGER_H_
-
-#include "etGlobalFlags.h"
-
-void etMSCLogger_open(char* logPath, char* mscName);
-void etMSCLogger_close(void);
-
-void etMSCLogger_setObjectName(char* objectName);
-char* etMSCLogger_getObjectName(void);
-
-void etMSCLogger_syncCall(char* sourceName, char* messageName, char* targetName);
-void etMSCLogger_syncReturn(char* sourceName, char* targetName);
-
-void etMSCLogger_asyncOut(char* sourceName, char* messageName, char* targetName);
-void etMSCLogger_asyncIn(char* sourceName, char* messageName, char* targetName);
-
-#ifdef ET_MSC_LOGGER_ACTIVATE
- #define ET_MSC_LOGGER_OPEN(object) \
- etMSCLogger_open("tmp", "msc"); \
- etMSCLogger_setObjectName(object);
-
- #define ET_MSC_LOGGER_CLOSE etMSCLogger_close();
-
- #define ET_MSC_LOGGER_SYNC_ENTRY(object, message) \
- char* sourceName = etMSCLogger_getObjectName(); \
- char* targetName = object; \
- etMSCLogger_syncCall(sourceName, message, targetName); \
- etMSCLogger_setObjectName(targetName);
-
- #define ET_MSC_LOGGER_SYNC_EXIT \
- etMSCLogger_syncReturn(sourceName, targetName); \
- etMSCLogger_setObjectName(sourceName);
-
-#else
- #define ET_MSC_LOGGER_OPEN
- #define ET_MSC_LOGGER_CLOSE
-
- #define ET_MSC_LOGGER_SYNC_ENTRY(object, message)
- #define ET_MSC_LOGGER_SYNC_EXIT
-#endif
-
-
-#endif /* _ETMSCLOGGER_H_ */
+/*******************************************************************************
+ * Copyright (c) 2012 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+#ifndef _ETMSCLOGGER_H_
+#define _ETMSCLOGGER_H_
+
+#include "etGlobalFlags.h"
+
+void etMSCLogger_open(char* logPath, char* mscName);
+void etMSCLogger_close(void);
+
+void etMSCLogger_setObjectName(char* objectName);
+char* etMSCLogger_getObjectName(void);
+
+void etMSCLogger_syncCall(char* sourceName, char* messageName, char* targetName);
+void etMSCLogger_syncReturn(char* sourceName, char* targetName);
+
+void etMSCLogger_asyncOut(char* sourceName, char* messageName, char* targetName);
+void etMSCLogger_asyncIn(char* sourceName, char* messageName, char* targetName);
+
+#ifdef ET_MSC_LOGGER_ACTIVATE
+ #define ET_MSC_LOGGER_OPEN(object) \
+ etMSCLogger_open("tmp", "msc"); \
+ etMSCLogger_setObjectName(object);
+
+ #define ET_MSC_LOGGER_CLOSE etMSCLogger_close();
+
+ #define ET_MSC_LOGGER_SYNC_ENTRY(object, message) \
+ char* sourceName = etMSCLogger_getObjectName(); \
+ char* targetName = object; \
+ etMSCLogger_syncCall(sourceName, message, targetName); \
+ etMSCLogger_setObjectName(targetName);
+
+ #define ET_MSC_LOGGER_SYNC_EXIT \
+ etMSCLogger_syncReturn(sourceName, targetName); \
+ etMSCLogger_setObjectName(sourceName);
+
+#else
+ #define ET_MSC_LOGGER_OPEN
+ #define ET_MSC_LOGGER_CLOSE
+
+ #define ET_MSC_LOGGER_SYNC_ENTRY(object, message)
+ #define ET_MSC_LOGGER_SYNC_EXIT
+#endif
+
+
+#endif /* _ETMSCLOGGER_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c b/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c
index e1880b761..4facacbcd 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c
@@ -1,334 +1,334 @@
-/*******************************************************************************
- * Copyright (c) 2011 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 (initial contribution)
- *
- *******************************************************************************/
-
-#include "etUnit/etUnit.h"
-#include <string.h>
-#include <time.h>
-#include "debugging/etLogger.h"
-
-
-/*** member variables */
-
-/* file handling */
-static FILE* etUnit_reportfile = NULL;
-
-/* names */
-static char* etUnit_TestFileName = NULL;
-static char* etUnit_TestResultPath = NULL;
-
-static char* etUnit_TestSuiteName = NULL;
-static char* etUnit_TestCaseName = NULL;
-
-/* counters */
-static etInt32 etUnit_passCount = 0;
-static etInt32 etUnit_failCount = 0;
-static etInt32 etUnit_passCountTotal = 0;
-static etInt32 etUnit_failCountTotal = 0;
-
-static etBool etUnit_testcaseSuccess = TRUE;
-
-#define ETUNIT_FAILURE_TEXT_LEN 256
-
-static char etUnit_failureText[ETUNIT_FAILURE_TEXT_LEN];
-
-/* time measuring */
-static clock_t etUnit_startTime = 0;
-static clock_t etUnit_currentTime = 0;
-
-/* forward declarations of private functions */
-void expect_equal_int(const char* message, etInt32 expected, etInt32 actual);
-void expect_equal_uint(const char* message, etUInt32 expected, etUInt32 actual);
-void expect_equal_float(const char* message, etFloat32 expected, etFloat32 actual, etFloat32 precision);
-void etUnit_writeTestLog(const char *testcase, etBool result, const char *resulttext);
-void etUnit_handleExpect(etBool result, const char *resulttext);
-
-/* public functions */
-
-void etUnit_open(char* testResultPath, char* testFileName) {
- etUnit_passCount = 0;
- etUnit_failCount = 0;
- strcpy(etUnit_failureText,"");
-
- etUnit_TestFileName = testFileName;
- etUnit_TestResultPath = testResultPath;
-
- etLogger_logInfoF("************* TEST START (%s) **************", etUnit_TestFileName);
-
- char filename[ETUNIT_FAILURE_TEXT_LEN];
- sprintf(filename, "%s/%s.xml", etUnit_TestResultPath, etUnit_TestFileName);
-
- if (etUnit_reportfile == NULL) {
- etUnit_reportfile = etLogger_fopen(filename, "w+");
- if (etUnit_reportfile != NULL) {
- etLogger_fprintf(etUnit_reportfile, "<testsuites name=\"%s\" tests=\"0\" failures=\"0\" errors=\"0\" time=\"0\">\n", etUnit_TestFileName);
- } else {
- etLogger_logErrorF("Unable to open file %s/%s.xml", etUnit_TestResultPath, etUnit_TestFileName);
- }
- }
- /* prepare time measurement */
- etUnit_startTime = clock();
- etUnit_currentTime = clock();
- etLogger_logInfoF("Start Time: %ld", etUnit_startTime);
-
-}
-
-void etUnit_close(void) {
- etLogger_logInfoF("");
- if (etUnit_failCount > 0) {
- etLogger_logInfoF("************* TEST FAILED *************");
- } else {
- etLogger_logInfoF("************* TEST PASSED *************");
- }
- etLogger_logInfoF("Number of Tests: %ld", etUnit_failCount + etUnit_passCount);
- etLogger_logInfoF("Failed: %ld", etUnit_failCount);
- etLogger_logInfoF("Passed: %ld", etUnit_passCount);
- etLogger_logInfoF("Time: %ld", clock() - etUnit_startTime);
- etLogger_logInfoF("End Time: %ld[ms]", (clock() / 1000) * CLOCKS_PER_SEC );
- etLogger_logInfoF("***************************************");
- if (etUnit_failCountTotal > 0) {
- etLogger_logInfoF(" ******* %d TEST(S) FAILED *****", etUnit_failCountTotal);
- } else {
- etLogger_logInfoF(" ******* ALL TESTS PASSED ******");
- }
- etLogger_logInfoF("***************************************");
-
- if (etUnit_reportfile != NULL) {
- etLogger_fprintf(etUnit_reportfile, "</testsuites>\n");
- etLogger_fclose(etUnit_reportfile);
- etUnit_reportfile = NULL;
- }
-}
-
-void etUnit_openTestSuite(char* testSuiteName) {
- etUnit_TestSuiteName = testSuiteName;
- if (etUnit_reportfile != NULL) {
- etLogger_fprintf(etUnit_reportfile, "\t<testsuite name=\"%s\" tests=\"0\" failures=\"0\" errors=\"0\" time=\"0\">\n",
- etUnit_TestSuiteName);
- }
-}
-
-void etUnit_closeTestSuite(void) {
- if (etUnit_reportfile != NULL) {
- etLogger_fprintf(etUnit_reportfile, "\t</testsuite>\n");
- }
-}
-
-void etUnit_openTestCase(char* testCaseName) {
- etUnit_TestCaseName = testCaseName;
- etUnit_testcaseSuccess = TRUE;
- strcpy(etUnit_failureText,"");
-}
-
-void etUnit_closeTestCase(void) {
- if (etUnit_reportfile != NULL && etUnit_TestSuiteName != NULL) {
- etUnit_writeTestLog(etUnit_TestCaseName, etUnit_testcaseSuccess, etUnit_failureText);
- }
-}
-
-void etUnit_openAll(char* testResultPath, char* testFileName, char* testSuiteName, char* testCaseName){
- etUnit_open(testResultPath, testFileName);
- etUnit_openTestSuite(testSuiteName);
- etUnit_openTestCase(testCaseName);
-}
-
-void etUnit_closeAll(void){
- etUnit_closeTestCase();
- etUnit_closeTestSuite();
- etUnit_close();
-}
-
-void EXPECT_TRUE(const char* message, etBool condition) {
- if (condition == FALSE) {
- char testresult[ETUNIT_FAILURE_TEXT_LEN];
- sprintf(testresult, "%s: *** EXPECT_TRUE == FALSE", message);
- etUnit_handleExpect(FALSE, testresult);
- } else {
- etUnit_handleExpect(TRUE, "");
- }
-}
-
-void EXPECT_FALSE(const char* message, etBool condition) {
- if (condition == TRUE) {
- char testresult[ETUNIT_FAILURE_TEXT_LEN];
- sprintf(testresult, "%s: EXPECT_FALSE == TRUE", message);
- etUnit_handleExpect(FALSE, testresult);
- } else {
- etUnit_handleExpect(TRUE, "");
- }
-}
-
-void EXPECT_EQUAL_INT8(const char* message, etInt8 expected, etInt8 actual) {
- expect_equal_int(message, (etInt32) expected, (etInt32) actual);
-}
-
-void EXPECT_EQUAL_INT16(const char* message, etInt16 expected, etInt16 actual) {
- expect_equal_int(message, (etInt32) expected, (etInt32) actual);
-}
-
-void EXPECT_EQUAL_INT32(const char* message, etInt32 expected, etInt32 actual) {
- expect_equal_int(message, (etInt32) expected, (etInt32) actual);
-}
-
-void EXPECT_EQUAL_UINT8(const char* message, etUInt8 expected, etUInt8 actual) {
- expect_equal_uint(message, (etUInt32) expected, (etUInt32) actual);
-}
-
-void EXPECT_EQUAL_UINT16(const char* message, etUInt16 expected, etUInt16 actual) {
- expect_equal_uint(message, (etUInt32) expected, (etUInt32) actual);
-}
-
-void EXPECT_EQUAL_UINT32(const char* message, etUInt32 expected, etUInt32 actual) {
- expect_equal_uint(message, (etUInt32) expected, (etUInt32) actual);
-}
-
-
-void EXPECT_EQUAL_FLOAT32(const char* message, etFloat32 expected, etFloat32 actual, etFloat32 precision) {
- expect_equal_float(message, expected, actual, precision);
-}
-
-/* order */
-static etInt16 etUnit_orderCurrentIndex = 0;
-static etInt16 etUnit_orderSize = 0;
-static etInt16* etUnit_orderList = NULL;
-
-void EXPECT_ORDER_START(etInt16* list, etInt16 size){
- etUnit_orderCurrentIndex = 0;
- etUnit_orderSize = size;
- etUnit_orderList = list;
-}
-
-void EXPECT_ORDER(const char* message, etInt16 identifier){
- if (etUnit_orderCurrentIndex < etUnit_orderSize) {
- if (etUnit_orderList[etUnit_orderCurrentIndex] != identifier){
- char testresult[ETUNIT_FAILURE_TEXT_LEN];
- sprintf(testresult, "EXPECT_ORDER %s: index=%d, expected=%d, actual=%d", message, etUnit_orderCurrentIndex, identifier, etUnit_orderList[etUnit_orderCurrentIndex]);
- etUnit_handleExpect(FALSE, testresult);
- }
- else {
- etUnit_handleExpect(TRUE, "");
- etUnit_orderCurrentIndex++;
- }
- }
- else {
- char testresult[ETUNIT_FAILURE_TEXT_LEN];
- sprintf(testresult, "EXPECT_ORDER: index(%d) is too big in %s", etUnit_orderCurrentIndex, message);
- etUnit_handleExpect(FALSE, testresult);
- etLogger_logInfoF("EXPECT_ORDER: index too big in %s", message);
- }
-}
-
-void EXPECT_ORDER_END(const char* message, etInt16 identifier){
- EXPECT_ORDER(message, identifier);
- if (etUnit_orderCurrentIndex != etUnit_orderSize){
- char testresult[ETUNIT_FAILURE_TEXT_LEN];
- sprintf(testresult, "EXPECT_ORDER_END %s: wrong index at the end: expected=%d, actual=%d", message, etUnit_orderSize, etUnit_orderCurrentIndex);
- etUnit_handleExpect(FALSE, testresult);
- }
-}
-
-/* private functions */
-
-void expect_equal_int(const char* message, etInt32 expected, etInt32 actual) {
- if (expected != actual) {
- char testresult[ETUNIT_FAILURE_TEXT_LEN];
- sprintf(testresult, "%s: expected=%ld, actual=%ld", message, expected, actual);
- etUnit_handleExpect(FALSE, testresult);
- } else {
- etUnit_handleExpect(TRUE, "");
- }
-}
-
-void expect_equal_uint(const char* message, etUInt32 expected, etUInt32 actual) {
- if (expected != actual) {
- char testresult[ETUNIT_FAILURE_TEXT_LEN];
- sprintf(testresult, "%s: expected=%lu, actual=%lu", message, expected, actual);
- etUnit_handleExpect(FALSE, testresult);
- } else {
- etUnit_handleExpect(TRUE, "");
- }
-}
-
-
-void expect_equal_float(const char* message, etFloat32 expected, etFloat32 actual, etFloat32 precision) {
- if (expected - actual < -precision || expected - actual > precision) {
- char testresult[ETUNIT_FAILURE_TEXT_LEN];
- sprintf(testresult, "%s: expected=%f, actual=%f", message, expected, actual);
- etUnit_handleExpect(FALSE, testresult);
- } else {
- etUnit_handleExpect(TRUE, "");
- }
-}
-
-void expect_equal_void_ptr(const char* message, const void* expected, const void* actual) {
- if (expected != actual) {
- char testresult[ETUNIT_FAILURE_TEXT_LEN];
- sprintf(testresult, "%s: expected=%ld, actual=%ld", message, (etUInt32) expected, (etUInt32) actual);
- etUnit_handleExpect(FALSE, testresult);
- } else {
- etUnit_handleExpect(TRUE, "");
- }
-}
-
-
-//_________
-
-void etUnit_handleExpect(etBool result, const char *resulttext){
- if (result == TRUE) {
- /* nothing to do because no failure */
- }
- else {
- if (etUnit_testcaseSuccess == TRUE){
- /* first failure will be remembered */
- etUnit_testcaseSuccess = FALSE;
- strcpy(etUnit_failureText, resulttext);
- }
- else{
- /* more than one error will be ignored */
- }
- }
-}
-
-void etUnit_buildTestLogXML(char* xml, const char *testcase, etBool result, const char *resulttext, clock_t time) {
- if (result == TRUE) {
- sprintf(xml, "\t\t<testcase name=\"%s\" time=\"%ld\"/>\n", testcase, time);
- } else {
- sprintf(
- xml,
- "\t\t<testcase name=\"%s\" classname=\"none\" time=\"%ld\">\n\t\t\t<failure>%s</failure>\n\t\t</testcase>\n",
- testcase, time, resulttext);
- }
-}
-
-void etUnit_writeTestLog(const char *testcase, etBool result, const char *resulttext) {
- char writeBuffer[ETUNIT_FAILURE_TEXT_LEN];
-
- // counting
- if (result == TRUE) {
- etUnit_passCount++;
- etUnit_passCountTotal++;
- etLogger_logInfoF("PASS: %s %s", testcase, resulttext);
- } else {
- etUnit_failCount++;
- etUnit_failCountTotal++;
- etLogger_logInfoF("FAIL: %s : %s", testcase, resulttext);
- }
-
- clock_t time = clock() - etUnit_currentTime;
- etUnit_currentTime = clock();
-
- // writing to file
- if (etUnit_reportfile != NULL) {
- etUnit_buildTestLogXML(writeBuffer, testcase, result, resulttext, time);
- etLogger_fprintf(etUnit_reportfile, writeBuffer);
- }
-}
-
+/*******************************************************************************
+ * Copyright (c) 2011 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+#include "etUnit/etUnit.h"
+#include <string.h>
+#include <time.h>
+#include "debugging/etLogger.h"
+
+
+/*** member variables */
+
+/* file handling */
+static FILE* etUnit_reportfile = NULL;
+
+/* names */
+static char* etUnit_TestFileName = NULL;
+static char* etUnit_TestResultPath = NULL;
+
+static char* etUnit_TestSuiteName = NULL;
+static char* etUnit_TestCaseName = NULL;
+
+/* counters */
+static etInt32 etUnit_passCount = 0;
+static etInt32 etUnit_failCount = 0;
+static etInt32 etUnit_passCountTotal = 0;
+static etInt32 etUnit_failCountTotal = 0;
+
+static etBool etUnit_testcaseSuccess = TRUE;
+
+#define ETUNIT_FAILURE_TEXT_LEN 256
+
+static char etUnit_failureText[ETUNIT_FAILURE_TEXT_LEN];
+
+/* time measuring */
+static clock_t etUnit_startTime = 0;
+static clock_t etUnit_currentTime = 0;
+
+/* forward declarations of private functions */
+void expect_equal_int(const char* message, etInt32 expected, etInt32 actual);
+void expect_equal_uint(const char* message, etUInt32 expected, etUInt32 actual);
+void expect_equal_float(const char* message, etFloat32 expected, etFloat32 actual, etFloat32 precision);
+void etUnit_writeTestLog(const char *testcase, etBool result, const char *resulttext);
+void etUnit_handleExpect(etBool result, const char *resulttext);
+
+/* public functions */
+
+void etUnit_open(char* testResultPath, char* testFileName) {
+ etUnit_passCount = 0;
+ etUnit_failCount = 0;
+ strcpy(etUnit_failureText,"");
+
+ etUnit_TestFileName = testFileName;
+ etUnit_TestResultPath = testResultPath;
+
+ etLogger_logInfoF("************* TEST START (%s) **************", etUnit_TestFileName);
+
+ char filename[ETUNIT_FAILURE_TEXT_LEN];
+ sprintf(filename, "%s/%s.xml", etUnit_TestResultPath, etUnit_TestFileName);
+
+ if (etUnit_reportfile == NULL) {
+ etUnit_reportfile = etLogger_fopen(filename, "w+");
+ if (etUnit_reportfile != NULL) {
+ etLogger_fprintf(etUnit_reportfile, "<testsuites name=\"%s\" tests=\"0\" failures=\"0\" errors=\"0\" time=\"0\">\n", etUnit_TestFileName);
+ } else {
+ etLogger_logErrorF("Unable to open file %s/%s.xml", etUnit_TestResultPath, etUnit_TestFileName);
+ }
+ }
+ /* prepare time measurement */
+ etUnit_startTime = clock();
+ etUnit_currentTime = clock();
+ etLogger_logInfoF("Start Time: %ld", etUnit_startTime);
+
+}
+
+void etUnit_close(void) {
+ etLogger_logInfoF("");
+ if (etUnit_failCount > 0) {
+ etLogger_logInfoF("************* TEST FAILED *************");
+ } else {
+ etLogger_logInfoF("************* TEST PASSED *************");
+ }
+ etLogger_logInfoF("Number of Tests: %ld", etUnit_failCount + etUnit_passCount);
+ etLogger_logInfoF("Failed: %ld", etUnit_failCount);
+ etLogger_logInfoF("Passed: %ld", etUnit_passCount);
+ etLogger_logInfoF("Time: %ld", clock() - etUnit_startTime);
+ etLogger_logInfoF("End Time: %ld[ms]", (clock() / 1000) * CLOCKS_PER_SEC );
+ etLogger_logInfoF("***************************************");
+ if (etUnit_failCountTotal > 0) {
+ etLogger_logInfoF(" ******* %d TEST(S) FAILED *****", etUnit_failCountTotal);
+ } else {
+ etLogger_logInfoF(" ******* ALL TESTS PASSED ******");
+ }
+ etLogger_logInfoF("***************************************");
+
+ if (etUnit_reportfile != NULL) {
+ etLogger_fprintf(etUnit_reportfile, "</testsuites>\n");
+ etLogger_fclose(etUnit_reportfile);
+ etUnit_reportfile = NULL;
+ }
+}
+
+void etUnit_openTestSuite(char* testSuiteName) {
+ etUnit_TestSuiteName = testSuiteName;
+ if (etUnit_reportfile != NULL) {
+ etLogger_fprintf(etUnit_reportfile, "\t<testsuite name=\"%s\" tests=\"0\" failures=\"0\" errors=\"0\" time=\"0\">\n",
+ etUnit_TestSuiteName);
+ }
+}
+
+void etUnit_closeTestSuite(void) {
+ if (etUnit_reportfile != NULL) {
+ etLogger_fprintf(etUnit_reportfile, "\t</testsuite>\n");
+ }
+}
+
+void etUnit_openTestCase(char* testCaseName) {
+ etUnit_TestCaseName = testCaseName;
+ etUnit_testcaseSuccess = TRUE;
+ strcpy(etUnit_failureText,"");
+}
+
+void etUnit_closeTestCase(void) {
+ if (etUnit_reportfile != NULL && etUnit_TestSuiteName != NULL) {
+ etUnit_writeTestLog(etUnit_TestCaseName, etUnit_testcaseSuccess, etUnit_failureText);
+ }
+}
+
+void etUnit_openAll(char* testResultPath, char* testFileName, char* testSuiteName, char* testCaseName){
+ etUnit_open(testResultPath, testFileName);
+ etUnit_openTestSuite(testSuiteName);
+ etUnit_openTestCase(testCaseName);
+}
+
+void etUnit_closeAll(void){
+ etUnit_closeTestCase();
+ etUnit_closeTestSuite();
+ etUnit_close();
+}
+
+void EXPECT_TRUE(const char* message, etBool condition) {
+ if (condition == FALSE) {
+ char testresult[ETUNIT_FAILURE_TEXT_LEN];
+ sprintf(testresult, "%s: *** EXPECT_TRUE == FALSE", message);
+ etUnit_handleExpect(FALSE, testresult);
+ } else {
+ etUnit_handleExpect(TRUE, "");
+ }
+}
+
+void EXPECT_FALSE(const char* message, etBool condition) {
+ if (condition == TRUE) {
+ char testresult[ETUNIT_FAILURE_TEXT_LEN];
+ sprintf(testresult, "%s: EXPECT_FALSE == TRUE", message);
+ etUnit_handleExpect(FALSE, testresult);
+ } else {
+ etUnit_handleExpect(TRUE, "");
+ }
+}
+
+void EXPECT_EQUAL_INT8(const char* message, etInt8 expected, etInt8 actual) {
+ expect_equal_int(message, (etInt32) expected, (etInt32) actual);
+}
+
+void EXPECT_EQUAL_INT16(const char* message, etInt16 expected, etInt16 actual) {
+ expect_equal_int(message, (etInt32) expected, (etInt32) actual);
+}
+
+void EXPECT_EQUAL_INT32(const char* message, etInt32 expected, etInt32 actual) {
+ expect_equal_int(message, (etInt32) expected, (etInt32) actual);
+}
+
+void EXPECT_EQUAL_UINT8(const char* message, etUInt8 expected, etUInt8 actual) {
+ expect_equal_uint(message, (etUInt32) expected, (etUInt32) actual);
+}
+
+void EXPECT_EQUAL_UINT16(const char* message, etUInt16 expected, etUInt16 actual) {
+ expect_equal_uint(message, (etUInt32) expected, (etUInt32) actual);
+}
+
+void EXPECT_EQUAL_UINT32(const char* message, etUInt32 expected, etUInt32 actual) {
+ expect_equal_uint(message, (etUInt32) expected, (etUInt32) actual);
+}
+
+
+void EXPECT_EQUAL_FLOAT32(const char* message, etFloat32 expected, etFloat32 actual, etFloat32 precision) {
+ expect_equal_float(message, expected, actual, precision);
+}
+
+/* order */
+static etInt16 etUnit_orderCurrentIndex = 0;
+static etInt16 etUnit_orderSize = 0;
+static etInt16* etUnit_orderList = NULL;
+
+void EXPECT_ORDER_START(etInt16* list, etInt16 size){
+ etUnit_orderCurrentIndex = 0;
+ etUnit_orderSize = size;
+ etUnit_orderList = list;
+}
+
+void EXPECT_ORDER(const char* message, etInt16 identifier){
+ if (etUnit_orderCurrentIndex < etUnit_orderSize) {
+ if (etUnit_orderList[etUnit_orderCurrentIndex] != identifier){
+ char testresult[ETUNIT_FAILURE_TEXT_LEN];
+ sprintf(testresult, "EXPECT_ORDER %s: index=%d, expected=%d, actual=%d", message, etUnit_orderCurrentIndex, identifier, etUnit_orderList[etUnit_orderCurrentIndex]);
+ etUnit_handleExpect(FALSE, testresult);
+ }
+ else {
+ etUnit_handleExpect(TRUE, "");
+ etUnit_orderCurrentIndex++;
+ }
+ }
+ else {
+ char testresult[ETUNIT_FAILURE_TEXT_LEN];
+ sprintf(testresult, "EXPECT_ORDER: index(%d) is too big in %s", etUnit_orderCurrentIndex, message);
+ etUnit_handleExpect(FALSE, testresult);
+ etLogger_logInfoF("EXPECT_ORDER: index too big in %s", message);
+ }
+}
+
+void EXPECT_ORDER_END(const char* message, etInt16 identifier){
+ EXPECT_ORDER(message, identifier);
+ if (etUnit_orderCurrentIndex != etUnit_orderSize){
+ char testresult[ETUNIT_FAILURE_TEXT_LEN];
+ sprintf(testresult, "EXPECT_ORDER_END %s: wrong index at the end: expected=%d, actual=%d", message, etUnit_orderSize, etUnit_orderCurrentIndex);
+ etUnit_handleExpect(FALSE, testresult);
+ }
+}
+
+/* private functions */
+
+void expect_equal_int(const char* message, etInt32 expected, etInt32 actual) {
+ if (expected != actual) {
+ char testresult[ETUNIT_FAILURE_TEXT_LEN];
+ sprintf(testresult, "%s: expected=%ld, actual=%ld", message, expected, actual);
+ etUnit_handleExpect(FALSE, testresult);
+ } else {
+ etUnit_handleExpect(TRUE, "");
+ }
+}
+
+void expect_equal_uint(const char* message, etUInt32 expected, etUInt32 actual) {
+ if (expected != actual) {
+ char testresult[ETUNIT_FAILURE_TEXT_LEN];
+ sprintf(testresult, "%s: expected=%lu, actual=%lu", message, expected, actual);
+ etUnit_handleExpect(FALSE, testresult);
+ } else {
+ etUnit_handleExpect(TRUE, "");
+ }
+}
+
+
+void expect_equal_float(const char* message, etFloat32 expected, etFloat32 actual, etFloat32 precision) {
+ if (expected - actual < -precision || expected - actual > precision) {
+ char testresult[ETUNIT_FAILURE_TEXT_LEN];
+ sprintf(testresult, "%s: expected=%f, actual=%f", message, expected, actual);
+ etUnit_handleExpect(FALSE, testresult);
+ } else {
+ etUnit_handleExpect(TRUE, "");
+ }
+}
+
+void expect_equal_void_ptr(const char* message, const void* expected, const void* actual) {
+ if (expected != actual) {
+ char testresult[ETUNIT_FAILURE_TEXT_LEN];
+ sprintf(testresult, "%s: expected=%ld, actual=%ld", message, (etUInt32) expected, (etUInt32) actual);
+ etUnit_handleExpect(FALSE, testresult);
+ } else {
+ etUnit_handleExpect(TRUE, "");
+ }
+}
+
+
+//_________
+
+void etUnit_handleExpect(etBool result, const char *resulttext){
+ if (result == TRUE) {
+ /* nothing to do because no failure */
+ }
+ else {
+ if (etUnit_testcaseSuccess == TRUE){
+ /* first failure will be remembered */
+ etUnit_testcaseSuccess = FALSE;
+ strcpy(etUnit_failureText, resulttext);
+ }
+ else{
+ /* more than one error will be ignored */
+ }
+ }
+}
+
+void etUnit_buildTestLogXML(char* xml, const char *testcase, etBool result, const char *resulttext, clock_t time) {
+ if (result == TRUE) {
+ sprintf(xml, "\t\t<testcase name=\"%s\" time=\"%ld\"/>\n", testcase, time);
+ } else {
+ sprintf(
+ xml,
+ "\t\t<testcase name=\"%s\" classname=\"none\" time=\"%ld\">\n\t\t\t<failure>%s</failure>\n\t\t</testcase>\n",
+ testcase, time, resulttext);
+ }
+}
+
+void etUnit_writeTestLog(const char *testcase, etBool result, const char *resulttext) {
+ char writeBuffer[ETUNIT_FAILURE_TEXT_LEN];
+
+ // counting
+ if (result == TRUE) {
+ etUnit_passCount++;
+ etUnit_passCountTotal++;
+ etLogger_logInfoF("PASS: %s %s", testcase, resulttext);
+ } else {
+ etUnit_failCount++;
+ etUnit_failCountTotal++;
+ etLogger_logInfoF("FAIL: %s : %s", testcase, resulttext);
+ }
+
+ clock_t time = clock() - etUnit_currentTime;
+ etUnit_currentTime = clock();
+
+ // writing to file
+ if (etUnit_reportfile != NULL) {
+ etUnit_buildTestLogXML(writeBuffer, testcase, result, resulttext, time);
+ etLogger_fprintf(etUnit_reportfile, writeBuffer);
+ }
+}
+
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h b/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h
index 2a25289bc..5daa4aa95 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h
@@ -1,69 +1,69 @@
-/*******************************************************************************
- * Copyright (c) 2011 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 (initial contribution)
- *
- *******************************************************************************/
-
-#ifndef _ETUNIT_H_
-#define _ETUNIT_H_
-
-#include "etDatatypes.h"
-
-
-/* open / close */
-void etUnit_open(char* testResultPath, char* testFileName);
-void etUnit_close(void);
-void etUnit_openTestSuite(char* testSuiteName);
-void etUnit_closeTestSuite(void);
-void etUnit_openTestCase(char* testCaseName);
-void etUnit_closeTestCase(void);
-
-/* functions for more convenience for model and generator tests */
-
-void etUnit_openAll(char* testResultPath, char* testFileName, char* testSuiteName, char* testCaseName);
-void etUnit_closeAll(void);
-
-/* boolean values */
-void EXPECT_TRUE(const char* testcase, etBool condition);
-void EXPECT_FALSE(const char* testcase, etBool condition);
-
-/* signed integer values */
-void EXPECT_EQUAL_INT8(const char* testcase, etInt8 expected, etInt8 actual);
-void EXPECT_EQUAL_INT16(const char* testcase, etInt16 expected, etInt16 actual);
-void EXPECT_EQUAL_INT32(const char* testcase, etInt32 expected, etInt32 actual);
-
-/* unsigned integer values */
-void EXPECT_EQUAL_UINT8(const char* testcase, etUInt8 expected, etUInt8 actual);
-void EXPECT_EQUAL_UINT16(const char* testcase, etUInt16 expected, etUInt16 actual);
-void EXPECT_EQUAL_UINT32(const char* testcase, etUInt32 expected, etUInt32 actual);
-
-/* float values */
-void EXPECT_EQUAL_FLOAT32(const char* testcase, etFloat32 expected, etFloat32 actual, etFloat32 precision);
-
-/* Pointers */
-#define EXPECT_EQUAL_PTR(testcase, expected, actual) \
- expect_equal_void_ptr(testcase, (const void*) expected, (const void*) actual);
-
-void expect_equal_void_ptr(const char* testcase, const void* expected, const void* actual);
-
-/* more specialized functions */
-void EXPECT_ORDER_START(etInt16* list, etInt16 size);
-void EXPECT_ORDER(const char* message, etInt16 identifier);
-void EXPECT_ORDER_END(const char* message, etInt16 identifier);
-
-
-/* Helpers for adding testcases */
-
-#define ADD_TESTCASE(testcase) \
- etUnit_openTestCase(#testcase); \
- testcase(); \
- etUnit_closeTestCase();
-
-
-#endif /* _ETUNIT_H_ */
+/*******************************************************************************
+ * Copyright (c) 2011 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+#ifndef _ETUNIT_H_
+#define _ETUNIT_H_
+
+#include "etDatatypes.h"
+
+
+/* open / close */
+void etUnit_open(char* testResultPath, char* testFileName);
+void etUnit_close(void);
+void etUnit_openTestSuite(char* testSuiteName);
+void etUnit_closeTestSuite(void);
+void etUnit_openTestCase(char* testCaseName);
+void etUnit_closeTestCase(void);
+
+/* functions for more convenience for model and generator tests */
+
+void etUnit_openAll(char* testResultPath, char* testFileName, char* testSuiteName, char* testCaseName);
+void etUnit_closeAll(void);
+
+/* boolean values */
+void EXPECT_TRUE(const char* testcase, etBool condition);
+void EXPECT_FALSE(const char* testcase, etBool condition);
+
+/* signed integer values */
+void EXPECT_EQUAL_INT8(const char* testcase, etInt8 expected, etInt8 actual);
+void EXPECT_EQUAL_INT16(const char* testcase, etInt16 expected, etInt16 actual);
+void EXPECT_EQUAL_INT32(const char* testcase, etInt32 expected, etInt32 actual);
+
+/* unsigned integer values */
+void EXPECT_EQUAL_UINT8(const char* testcase, etUInt8 expected, etUInt8 actual);
+void EXPECT_EQUAL_UINT16(const char* testcase, etUInt16 expected, etUInt16 actual);
+void EXPECT_EQUAL_UINT32(const char* testcase, etUInt32 expected, etUInt32 actual);
+
+/* float values */
+void EXPECT_EQUAL_FLOAT32(const char* testcase, etFloat32 expected, etFloat32 actual, etFloat32 precision);
+
+/* Pointers */
+#define EXPECT_EQUAL_PTR(testcase, expected, actual) \
+ expect_equal_void_ptr(testcase, (const void*) expected, (const void*) actual);
+
+void expect_equal_void_ptr(const char* testcase, const void* expected, const void* actual);
+
+/* more specialized functions */
+void EXPECT_ORDER_START(etInt16* list, etInt16 size);
+void EXPECT_ORDER(const char* message, etInt16 identifier);
+void EXPECT_ORDER_END(const char* message, etInt16 identifier);
+
+
+/* Helpers for adding testcases */
+
+#define ADD_TESTCASE(testcase) \
+ etUnit_openTestCase(#testcase); \
+ testcase(); \
+ etUnit_closeTestCase();
+
+
+#endif /* _ETUNIT_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessage.c b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessage.c
index 224461432..49772f7b6 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessage.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessage.c
@@ -1,25 +1,25 @@
-/*******************************************************************************
- * Copyright (c) 2011 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 (initial contribution)
- *
- *******************************************************************************/
-
-#include "messaging/etMessage.h"
-
-#include "debugging/etMSCLogger.h"
-
-#include <stddef.h>
-
-void etMessage_init(etMessage* self){
- ET_MSC_LOGGER_SYNC_ENTRY("etMessage", "init")
- self->next = NULL;
- self->address = 0;
- self->evtID = 0;
- ET_MSC_LOGGER_SYNC_EXIT
-}
+/*******************************************************************************
+ * Copyright (c) 2011 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+#include "messaging/etMessage.h"
+
+#include "debugging/etMSCLogger.h"
+
+#include <stddef.h>
+
+void etMessage_init(etMessage* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessage", "init")
+ self->next = NULL;
+ self->address = 0;
+ self->evtID = 0;
+ ET_MSC_LOGGER_SYNC_EXIT
+}
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessage.h b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessage.h
index 7bba6a1f3..698a89c09 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessage.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessage.h
@@ -1,26 +1,26 @@
-/*******************************************************************************
- * Copyright (c) 2011 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 (initial contribution)
- *
- *******************************************************************************/
-
-#ifndef _ETMESSAGE_H_
-#define _ETMESSAGE_H_
-
-#include "etDatatypes.h"
-
-typedef struct etMessage{
- struct etMessage* next;
- etInt16 address;
- etInt16 evtID;
-} etMessage;
-
-void etMessage_init(etMessage* self);
-
-#endif /* _ETMESSAGE_H_ */
+/*******************************************************************************
+ * Copyright (c) 2011 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+#ifndef _ETMESSAGE_H_
+#define _ETMESSAGE_H_
+
+#include "etDatatypes.h"
+
+typedef struct etMessage{
+ struct etMessage* next;
+ etInt16 address;
+ etInt16 evtID;
+} etMessage;
+
+void etMessage_init(etMessage* self);
+
+#endif /* _ETMESSAGE_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.c b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.c
index 2ba045420..b1a5fea54 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.c
@@ -1,99 +1,99 @@
-/*******************************************************************************
- * Copyright (c) 2011 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 (initial contribution)
- *
- *******************************************************************************/
-
-#include "messaging/etMessageQueue.h"
-
-#include "debugging/etMSCLogger.h"
-
-void etMessageQueue_init(etMessageQueue* self){
- ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "init")
- self->first = NULL;
- self->last = NULL;
- self->highWaterMark = 0;
- self->size = 0;
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-
-void etMessageQueue_push(etMessageQueue* self, etMessage* msg){
- // TODO: optimize queue for concurrent push / pop
- ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "push")
- if (self->first == NULL) {
- /*no message in queue*/
- self->first = self->last = msg;
- }
- else {
- /*at least one message in queue*/
- self->last->next = msg;
- self->last = msg;
- }
- msg->next = NULL; /*TODO: optimization: this line could be removed if we assume that all messages are initialized*/
-
- if (++self->size > self->highWaterMark)
- self->highWaterMark++;
-
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-etMessage* etMessageQueue_pop(etMessageQueue* self){
- ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "pop")
- etMessage* pop_msg = self->first;
- if(self->first == NULL){
- /*no message in queue*/
- ET_MSC_LOGGER_SYNC_EXIT
- return NULL;
- }
- if (self->first->next==NULL){
- /*only one message in queue*/
- self->first = self->last = NULL;
- }
- else {
- /*more than one message in queue -> set first to nex message*/
- self->first = self->first->next;
- }
-
- pop_msg->next=NULL;
- self->size--;
-
- ET_MSC_LOGGER_SYNC_EXIT
- return pop_msg;
-}
-
-etInt16 etMessageQueue_getSize(etMessageQueue* self) {
- ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "getSize")
- ET_MSC_LOGGER_SYNC_EXIT
- return self->size;
-}
-
-etMessage* etMessageQueue_getFirst(etMessageQueue* self){
- ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "getFirst")
- ET_MSC_LOGGER_SYNC_EXIT
- return self->first;
-}
-
-etMessage* etMessageQueue_getLast(etMessageQueue* self){
- ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "getLast")
- ET_MSC_LOGGER_SYNC_EXIT
- return self->last;
-}
-
-etBool etMessageQueue_isNotEmpty(etMessageQueue* self){
- ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "isNotEmpty")
- ET_MSC_LOGGER_SYNC_EXIT
- return self->last != NULL;
-}
-
-etInt16 etMessageQueue_getHighWaterMark(etMessageQueue* self) {
- ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "getHightWaterMark")
- ET_MSC_LOGGER_SYNC_EXIT
- return self->highWaterMark;
-}
+/*******************************************************************************
+ * Copyright (c) 2011 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+#include "messaging/etMessageQueue.h"
+
+#include "debugging/etMSCLogger.h"
+
+void etMessageQueue_init(etMessageQueue* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "init")
+ self->first = NULL;
+ self->last = NULL;
+ self->highWaterMark = 0;
+ self->size = 0;
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+
+void etMessageQueue_push(etMessageQueue* self, etMessage* msg){
+ // TODO: optimize queue for concurrent push / pop
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "push")
+ if (self->first == NULL) {
+ /*no message in queue*/
+ self->first = self->last = msg;
+ }
+ else {
+ /*at least one message in queue*/
+ self->last->next = msg;
+ self->last = msg;
+ }
+ msg->next = NULL; /*TODO: optimization: this line could be removed if we assume that all messages are initialized*/
+
+ if (++self->size > self->highWaterMark)
+ self->highWaterMark++;
+
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+etMessage* etMessageQueue_pop(etMessageQueue* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "pop")
+ etMessage* pop_msg = self->first;
+ if(self->first == NULL){
+ /*no message in queue*/
+ ET_MSC_LOGGER_SYNC_EXIT
+ return NULL;
+ }
+ if (self->first->next==NULL){
+ /*only one message in queue*/
+ self->first = self->last = NULL;
+ }
+ else {
+ /*more than one message in queue -> set first to nex message*/
+ self->first = self->first->next;
+ }
+
+ pop_msg->next=NULL;
+ self->size--;
+
+ ET_MSC_LOGGER_SYNC_EXIT
+ return pop_msg;
+}
+
+etInt16 etMessageQueue_getSize(etMessageQueue* self) {
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "getSize")
+ ET_MSC_LOGGER_SYNC_EXIT
+ return self->size;
+}
+
+etMessage* etMessageQueue_getFirst(etMessageQueue* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "getFirst")
+ ET_MSC_LOGGER_SYNC_EXIT
+ return self->first;
+}
+
+etMessage* etMessageQueue_getLast(etMessageQueue* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "getLast")
+ ET_MSC_LOGGER_SYNC_EXIT
+ return self->last;
+}
+
+etBool etMessageQueue_isNotEmpty(etMessageQueue* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "isNotEmpty")
+ ET_MSC_LOGGER_SYNC_EXIT
+ return self->last != NULL;
+}
+
+etInt16 etMessageQueue_getHighWaterMark(etMessageQueue* self) {
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "getHightWaterMark")
+ ET_MSC_LOGGER_SYNC_EXIT
+ return self->highWaterMark;
+}
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.h b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.h
index 473df5c0f..f305d1aa9 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.h
@@ -1,45 +1,45 @@
-/*******************************************************************************
- * Copyright (c) 2011 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 (initial contribution)
- *
- *******************************************************************************/
-
-#ifndef _ETMESSAGEQUEUE_H_
-#define _ETMESSAGEQUEUE_H_
-
-#include "messaging/etMessage.h"
-#include <stddef.h>
-
-typedef struct etMessageQueue {
- etMessage* first;
- etMessage* last;
- etInt16 highWaterMark;
- etInt16 size;
-
-} etMessageQueue;
-
-void etMessageQueue_init(etMessageQueue* self);
-
-void etMessageQueue_push(etMessageQueue* self, etMessage* msg);
-
-etMessage* etMessageQueue_pop(etMessageQueue* self);
-
-etMessage* etMessageQueue_getFirst(etMessageQueue* self);
-
-etMessage* etMessageQueue_getLast(etMessageQueue* self);
-
-etBool etMessageQueue_isNotEmpty(etMessageQueue* self);
-
-etInt16 etMessageQueue_getHighWaterMark(etMessageQueue* self);
-
-etInt16 etMessageQueue_getSize(etMessageQueue* self);
-
-
-
-#endif /* _RMESSAGEQUEUE_H_ */
+/*******************************************************************************
+ * Copyright (c) 2011 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+#ifndef _ETMESSAGEQUEUE_H_
+#define _ETMESSAGEQUEUE_H_
+
+#include "messaging/etMessage.h"
+#include <stddef.h>
+
+typedef struct etMessageQueue {
+ etMessage* first;
+ etMessage* last;
+ etInt16 highWaterMark;
+ etInt16 size;
+
+} etMessageQueue;
+
+void etMessageQueue_init(etMessageQueue* self);
+
+void etMessageQueue_push(etMessageQueue* self, etMessage* msg);
+
+etMessage* etMessageQueue_pop(etMessageQueue* self);
+
+etMessage* etMessageQueue_getFirst(etMessageQueue* self);
+
+etMessage* etMessageQueue_getLast(etMessageQueue* self);
+
+etBool etMessageQueue_isNotEmpty(etMessageQueue* self);
+
+etInt16 etMessageQueue_getHighWaterMark(etMessageQueue* self);
+
+etInt16 etMessageQueue_getSize(etMessageQueue* self);
+
+
+
+#endif /* _RMESSAGEQUEUE_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageReceiver.h b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageReceiver.h
index 5c6aa690a..a1bd92ce2 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageReceiver.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageReceiver.h
@@ -1,23 +1,23 @@
-/*******************************************************************************
- * Copyright (c) 2012 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 (initial contribution)
- *
- *******************************************************************************/
-
-
-
-#ifndef _ETMESSAGERECEIVER_H_
-#define _ETMESSAGERECEIVER_H_
-
-#include "messaging/etMessage.h"
-
-typedef void (*etActorReceiveMessage)(void* self, void* ifitem, const etMessage* msg);
-typedef void (*etDispatcherReceiveMessage)(const etMessage* msg);
-
-#endif /* _ETMESSAGERECEIVER_H_ */
+/*******************************************************************************
+ * Copyright (c) 2012 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+
+
+#ifndef _ETMESSAGERECEIVER_H_
+#define _ETMESSAGERECEIVER_H_
+
+#include "messaging/etMessage.h"
+
+typedef void (*etActorReceiveMessage)(void* self, void* ifitem, const etMessage* msg);
+typedef void (*etDispatcherReceiveMessage)(const etMessage* msg);
+
+#endif /* _ETMESSAGERECEIVER_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageService.c b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageService.c
index b7c91faf8..3755d2107 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageService.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageService.c
@@ -1,103 +1,103 @@
-/*******************************************************************************
- * Copyright (c) 2011 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 (initial contribution)
- *
- *******************************************************************************/
-
-
-#include "etMessageService.h"
-
-
-#include "debugging/etLogger.h"
-#include "debugging/etMSCLogger.h"
-
-void etMessageService_init(etMessageService* self, etUInt8* buffer, etUInt16 maxBlocks, etUInt16 blockSize, etDispatcherReceiveMessage msgDispatcher){
- ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "init")
- self->messageBuffer.buffer = buffer;
- self->messageBuffer.maxBlocks = maxBlocks;
- self->messageBuffer.blockSize = blockSize;
- self->msgDispatcher = msgDispatcher;
-
- etMessageQueue_init(&self->messagePool);
- etMessageQueue_init(&self->messageQueue);
-
- etMessageService_initMessagePool(self);
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-/*
- * initialize message pool with block buffer
- * all blocks are added to pool
- */
-void etMessageService_initMessagePool(etMessageService* self){
- ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "initMessagePool")
- etInt16 i;
-
- for (i=0; i<self->messageBuffer.maxBlocks; i++){
- etMessage* block = (etMessage*) &self->messageBuffer.buffer[i*self->messageBuffer.blockSize];
- etMessageQueue_push(&self->messagePool, block);
- }
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void etMessageService_pushMessage(etMessageService* self, etMessage* msg){
- ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "pushMessage")
- etMessageQueue_push(&self->messageQueue, msg);
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-etMessage* etMessageService_popMessage(etMessageService* self){
- ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "popMessage")
- etMessage* msg = etMessageQueue_pop(&self->messageQueue);
- ET_MSC_LOGGER_SYNC_EXIT
- return msg;
-}
-
-
-etMessage* etMessageService_getMessageBuffer(etMessageService* self, etUInt16 size){
- ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "getMessageBuffer")
- if (size<=self->messageBuffer.blockSize){
- if (self->messagePool.size>0){
- etMessage* msg = etMessageQueue_pop(&self->messagePool);
- ET_MSC_LOGGER_SYNC_EXIT
- return msg;
- }
- }
- ET_MSC_LOGGER_SYNC_EXIT
- return NULL;
-}
-
-void etMessageService_returnMessageBuffer(etMessageService* self, etMessage* buffer){
- ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "returnMessageBuffer")
- etMessageQueue_push(&self->messagePool, buffer);
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void etMessageService_deliverAllMessages(etMessageService* self){
- ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "deliverAllMessages")
- while (etMessageQueue_isNotEmpty(&self->messageQueue)){
- etMessage* msg = etMessageService_popMessage(self);
- self->msgDispatcher(msg);
- etMessageService_returnMessageBuffer(self, msg);
- }
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-void etMessageService_execute(etMessageService* self){
- ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "execute")
- etMessageService_deliverAllMessages(self);
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-etInt16 etMessageService_getMessagePoolLowWaterMark(etMessageService* self){
- ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "getMessagePoolLowWaterMark")
- etInt16 lowWaterMark = self->messageBuffer.maxBlocks - etMessageQueue_getHighWaterMark(&self->messageQueue);
- ET_MSC_LOGGER_SYNC_EXIT
- return lowWaterMark;
-}
+/*******************************************************************************
+ * Copyright (c) 2011 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+
+#include "etMessageService.h"
+
+
+#include "debugging/etLogger.h"
+#include "debugging/etMSCLogger.h"
+
+void etMessageService_init(etMessageService* self, etUInt8* buffer, etUInt16 maxBlocks, etUInt16 blockSize, etDispatcherReceiveMessage msgDispatcher){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "init")
+ self->messageBuffer.buffer = buffer;
+ self->messageBuffer.maxBlocks = maxBlocks;
+ self->messageBuffer.blockSize = blockSize;
+ self->msgDispatcher = msgDispatcher;
+
+ etMessageQueue_init(&self->messagePool);
+ etMessageQueue_init(&self->messageQueue);
+
+ etMessageService_initMessagePool(self);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+/*
+ * initialize message pool with block buffer
+ * all blocks are added to pool
+ */
+void etMessageService_initMessagePool(etMessageService* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "initMessagePool")
+ etInt16 i;
+
+ for (i=0; i<self->messageBuffer.maxBlocks; i++){
+ etMessage* block = (etMessage*) &self->messageBuffer.buffer[i*self->messageBuffer.blockSize];
+ etMessageQueue_push(&self->messagePool, block);
+ }
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+void etMessageService_pushMessage(etMessageService* self, etMessage* msg){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "pushMessage")
+ etMessageQueue_push(&self->messageQueue, msg);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+etMessage* etMessageService_popMessage(etMessageService* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "popMessage")
+ etMessage* msg = etMessageQueue_pop(&self->messageQueue);
+ ET_MSC_LOGGER_SYNC_EXIT
+ return msg;
+}
+
+
+etMessage* etMessageService_getMessageBuffer(etMessageService* self, etUInt16 size){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "getMessageBuffer")
+ if (size<=self->messageBuffer.blockSize){
+ if (self->messagePool.size>0){
+ etMessage* msg = etMessageQueue_pop(&self->messagePool);
+ ET_MSC_LOGGER_SYNC_EXIT
+ return msg;
+ }
+ }
+ ET_MSC_LOGGER_SYNC_EXIT
+ return NULL;
+}
+
+void etMessageService_returnMessageBuffer(etMessageService* self, etMessage* buffer){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "returnMessageBuffer")
+ etMessageQueue_push(&self->messagePool, buffer);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+void etMessageService_deliverAllMessages(etMessageService* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "deliverAllMessages")
+ while (etMessageQueue_isNotEmpty(&self->messageQueue)){
+ etMessage* msg = etMessageService_popMessage(self);
+ self->msgDispatcher(msg);
+ etMessageService_returnMessageBuffer(self, msg);
+ }
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+void etMessageService_execute(etMessageService* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "execute")
+ etMessageService_deliverAllMessages(self);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+etInt16 etMessageService_getMessagePoolLowWaterMark(etMessageService* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("etMessageService", "getMessagePoolLowWaterMark")
+ etInt16 lowWaterMark = self->messageBuffer.maxBlocks - etMessageQueue_getHighWaterMark(&self->messageQueue);
+ ET_MSC_LOGGER_SYNC_EXIT
+ return lowWaterMark;
+}
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageService.h b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageService.h
index f978e1eb7..0303bbf0c 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageService.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageService.h
@@ -1,50 +1,50 @@
-/*******************************************************************************
- * Copyright (c) 2011 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 (initial contribution)
- *
- *******************************************************************************/
-
-#ifndef _ETMESSAGESERVICE_H_
-#define _ETMESSAGESERVICE_H_
-
-#include <stddef.h>
-#include "etDatatypes.h"
-#include "messaging/etMessageQueue.h"
-#include "messaging/etMessageReceiver.h"
-
-typedef struct etBuffer{
- etUInt8 *buffer;
- etUInt16 maxBlocks;
- etUInt16 blockSize;
-} etBuffer;
-
-typedef struct etMessageService {
- etMessageQueue messageQueue;
- etMessageQueue messagePool;
- etBuffer messageBuffer;
- etDispatcherReceiveMessage msgDispatcher;
-} etMessageService;
-
-void etMessageService_init(etMessageService* self, etUInt8* buffer, etUInt16 maxBlocks, etUInt16 blockSize, etDispatcherReceiveMessage msgDispatcher);
-
-void etMessageService_initMessagePool(etMessageService* self);
-
-void etMessageService_pushMessage(etMessageService* self, etMessage* msg);
-etMessage* etMessageService_popMessage(etMessageService* self);
-
-etMessage* etMessageService_getMessageBuffer(etMessageService* self, etUInt16 size);
-void etMessageService_returnMessageBuffer(etMessageService* self, etMessage* buffer);
-
-void etMessageService_execute(etMessageService* self);
-
-/* functions for debug and service information */
-etInt16 etMessageService_getMessagePoolLowWaterMark(etMessageService* self);
-
-
-#endif /* RMESSAGESERVICE_H_ */
+/*******************************************************************************
+ * Copyright (c) 2011 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+#ifndef _ETMESSAGESERVICE_H_
+#define _ETMESSAGESERVICE_H_
+
+#include <stddef.h>
+#include "etDatatypes.h"
+#include "messaging/etMessageQueue.h"
+#include "messaging/etMessageReceiver.h"
+
+typedef struct etBuffer{
+ etUInt8 *buffer;
+ etUInt16 maxBlocks;
+ etUInt16 blockSize;
+} etBuffer;
+
+typedef struct etMessageService {
+ etMessageQueue messageQueue;
+ etMessageQueue messagePool;
+ etBuffer messageBuffer;
+ etDispatcherReceiveMessage msgDispatcher;
+} etMessageService;
+
+void etMessageService_init(etMessageService* self, etUInt8* buffer, etUInt16 maxBlocks, etUInt16 blockSize, etDispatcherReceiveMessage msgDispatcher);
+
+void etMessageService_initMessagePool(etMessageService* self);
+
+void etMessageService_pushMessage(etMessageService* self, etMessage* msg);
+etMessage* etMessageService_popMessage(etMessageService* self);
+
+etMessage* etMessageService_getMessageBuffer(etMessageService* self, etUInt16 size);
+void etMessageService_returnMessageBuffer(etMessageService* self, etMessage* buffer);
+
+void etMessageService_execute(etMessageService* self);
+
+/* functions for debug and service information */
+etInt16 etMessageService_getMessagePoolLowWaterMark(etMessageService* self);
+
+
+#endif /* RMESSAGESERVICE_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etActor.c b/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etActor.c
index dc7e1adcf..12d3808f0 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etActor.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etActor.c
@@ -1,18 +1,18 @@
-/*******************************************************************************
- * Copyright (c) 2012 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:
- * Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-
-#include "modelbase/etActor.h"
-
-boolean handleSystemEvent(InterfaceItemBase ifitem, int evt, void* generic_data) {
- /* TODO */
- return FALSE;
-}
+/*******************************************************************************
+ * Copyright (c) 2012 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+#include "modelbase/etActor.h"
+
+boolean handleSystemEvent(InterfaceItemBase ifitem, int evt, void* generic_data) {
+ /* TODO */
+ return FALSE;
+}
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etActor.h b/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etActor.h
index 8f115849f..88b6178cd 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etActor.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etActor.h
@@ -1,24 +1,24 @@
-/*******************************************************************************
- * Copyright (c) 2012 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:
- * Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-
-#ifndef _ETACTOR_H_
-#define _ETACTOR_H_
-
-#include "etDatatypes.h"
-#include "modelbase/etPort.h"
-
-#define NOT_CAUGHT 0
-#define EVT_SHIFT 100
-
-boolean handleSystemEvent(InterfaceItemBase ifitem, int evt, void* generic_data);
-
-#endif /* _ETACTOR_H_ */
+/*******************************************************************************
+ * Copyright (c) 2012 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+#ifndef _ETACTOR_H_
+#define _ETACTOR_H_
+
+#include "etDatatypes.h"
+#include "modelbase/etPort.h"
+
+#define NOT_CAUGHT 0
+#define EVT_SHIFT 100
+
+boolean handleSystemEvent(InterfaceItemBase ifitem, int evt, void* generic_data);
+
+#endif /* _ETACTOR_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etPort.c b/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etPort.c
index cbdbdaaf7..90b0f19cb 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etPort.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etPort.c
@@ -1,30 +1,41 @@
-/*******************************************************************************
- * Copyright (c) 2012 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 (initial contribution)
- *
- *******************************************************************************/
-
-#include "modelbase/etPort.h"
-
-#include "debugging/etMSCLogger.h"
-
-void etPort_receive(const etPort* self, const etMessage* msg) {
- ET_MSC_LOGGER_SYNC_ENTRY("etPort", "receive")
- if (self->receiveMessageFunc!=NULL)
- (self->receiveMessageFunc)(self->myActor, (void*)self, msg);
- ET_MSC_LOGGER_SYNC_EXIT
-}
-
-
-void etPort_sendMessage(const etPort* self, etInt16 evtId) {
- etMessage* msg = etMessageService_getMessageBuffer(self->msgService, sizeof(etMessage));
- msg->address = self->peerAddress;
- msg->evtID = evtId;
- etMessageService_pushMessage(self->msgService, msg);
-}
+/*******************************************************************************
+ * Copyright (c) 2012 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+#include "modelbase/etPort.h"
+
+#include "debugging/etMSCLogger.h"
+#include "platform/etMemory.h"
+#include <string.h>
+
+void etPort_receive(const etPort* self, const etMessage* msg) {
+ ET_MSC_LOGGER_SYNC_ENTRY("etPort", "receive")
+ if (self->receiveMessageFunc!=NULL)
+ (self->receiveMessageFunc)(self->myActor, (void*)self, msg);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+
+void etPort_sendMessage(const etPort* self, etInt16 evtId, int size, void* data) {
+ int offset = MEM_CEIL(sizeof(etMessage));
+ int totalSize = offset+size;
+ etMessage* msg = etMessageService_getMessageBuffer(self->msgService, totalSize);
+ if (msg!=NULL) {
+ msg->address = self->peerAddress;
+ msg->evtID = evtId;
+
+ if (size>0 && data!=NULL) {
+ memcpy(((char*)msg)+offset, data, size);
+ }
+
+ etMessageService_pushMessage(self->msgService, msg);
+ }
+}
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etPort.h b/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etPort.h
index 3ddecd74d..49321065a 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etPort.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etPort.h
@@ -1,62 +1,62 @@
-/*******************************************************************************
- * Copyright (c) 2012 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 (initial contribution)
- *
- *******************************************************************************/
-
-
-
-#ifndef _ETPORT_H_
-#define _ETPORT_H_
-
-
-#include "messaging/etMessage.h"
-#include "messaging/etMessageReceiver.h"
-#include "messaging/etMessageService.h"
-
-typedef struct {
- void* myActor;
- etActorReceiveMessage receiveMessageFunc;
- etMessageService* msgService;
- etAddressId peerAddress;
- etAddressId localId;
-
- #ifdef etDEBUG
- etAddressId address;
- /* thread ID from msg service: msgService->threadId */
- #endif
-} etPort;
-
-typedef struct {
- void* myActor;
- etActorReceiveMessage receiveMessageFunc;
- etMessageService* msgService;
- etAddressId peerAddress;
- etAddressId localId;
- etAddressId index;
-
- #ifdef etDEBUG
- etAddressId address;
- /* thread ID from msg service: msgService->threadId */
- #endif
-} etReplSubPort;
-
-typedef struct {
- etInt16 size;
- const etReplSubPort* ports;
-} etReplPort;
-
-typedef etPort* InterfaceItemBase;
-
-void etPort_receive(const etPort* self, const etMessage* msg);
-void etPort_sendMessage(const etPort* self, etInt16 evtId);
-
-
-
-#endif /* _ETPORT_H_ */
+/*******************************************************************************
+ * Copyright (c) 2012 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+
+
+#ifndef _ETPORT_H_
+#define _ETPORT_H_
+
+
+#include "messaging/etMessage.h"
+#include "messaging/etMessageReceiver.h"
+#include "messaging/etMessageService.h"
+
+typedef struct {
+ void* myActor;
+ etActorReceiveMessage receiveMessageFunc;
+ etMessageService* msgService;
+ etAddressId peerAddress;
+ etAddressId localId;
+
+ #ifdef etDEBUG
+ etAddressId address;
+ /* thread ID from msg service: msgService->threadId */
+ #endif
+} etPort;
+
+typedef struct {
+ void* myActor;
+ etActorReceiveMessage receiveMessageFunc;
+ etMessageService* msgService;
+ etAddressId peerAddress;
+ etAddressId localId;
+ etAddressId index;
+
+ #ifdef etDEBUG
+ etAddressId address;
+ /* thread ID from msg service: msgService->threadId */
+ #endif
+} etReplSubPort;
+
+typedef struct {
+ etInt16 size;
+ const etReplSubPort* ports;
+} etReplPort;
+
+typedef etPort* InterfaceItemBase;
+
+void etPort_receive(const etPort* self, const etMessage* msg);
+void etPort_sendMessage(const etPort* self, etInt16 evtId, int size, void* data);
+
+
+
+#endif /* _ETPORT_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/platform/etMemory.h b/runtime/org.eclipse.etrice.runtime.c/src/common/platform/etMemory.h
new file mode 100644
index 000000000..997c7053c
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/platform/etMemory.h
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+#ifndef _ETMEMORY_H_
+#define _ETMEMORY_H_
+
+#include "etDatatypes.h"
+#include "etGlobalFlags.h"
+
+#define CONSTANT_MEM_CEIL(n) \
+ ((n)+(((int32)STRUCT_ALIGN-((n)&((int32)STRUCT_ALIGN-1)))&((int32)STRUCT_ALIGN-1)))
+
+#define MEM_ALIGNMENT STRUCT_ALIGN /* power of 2 and >= sizeof(int) ! */
+#define MEM_CEIL(n) CONSTANT_MEM_CEIL(n)
+
+/* pool and block size */
+#define MESSAGE_POOL_MAX 50
+#define MESSAGE_BLOCK_SIZE 64
+
+#endif /* _ETMEMORY_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/platform/etPlatform.h b/runtime/org.eclipse.etrice.runtime.c/src/common/platform/etPlatform.h
index b462146fb..1f3c17ec3 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/platform/etPlatform.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/platform/etPlatform.h
@@ -1,27 +1,27 @@
-/*******************************************************************************
- * Copyright (c) 2012 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 (initial contribution)
- *
- *******************************************************************************/
-
-/*
- * etPlatform.h defines a generic interface for platform specific implementations
- *
- * */
-
-/*
- * Platform startup and shutdown -> generated code for SubSystemClass uses these interfaces
- * */
-
-void etUserEntry(void);
-void etUserPreRun(void);
-/* void etUserRun(void); */ /* TODO: do we need this function? */
-void etUserPostRun(void);
-void etUserExit(void);
-
+/*******************************************************************************
+ * Copyright (c) 2012 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+/*
+ * etPlatform.h defines a generic interface for platform specific implementations
+ *
+ * */
+
+/*
+ * Platform startup and shutdown -> generated code for SubSystemClass uses these interfaces
+ * */
+
+void etUserEntry(void);
+void etUserPreRun(void);
+/* void etUserRun(void); */ /* TODO: do we need this function? */
+void etUserPostRun(void);
+void etUserExit(void);
+
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etDatatypes.h b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etDatatypes.h
index aa948e6b4..a831f66ff 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etDatatypes.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etDatatypes.h
@@ -1,72 +1,72 @@
-/*******************************************************************************
- * Copyright (c) 2011 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 (initial contribution)
- *
- *******************************************************************************/
-
-#ifndef _ETDATATYPES_H_
-#define _ETDATATYPES_H_
-
-/*
- * typedefs for platform specific datatypes
- * Version for TI MSP 430
- *
- * */
-
-#include <stdio.h>
-
-/* unsigned integer datatypes */
-typedef unsigned char uint8;
-typedef unsigned short int uint16;
-typedef unsigned long uint32;
-/* typedef unsigned long long uint64; */ /* not available on this platform */
-
-/* signed integer datatypes */
-typedef char int8;
-typedef short int int16;
-typedef long int32;
-/* typedef long long int64; */ /* not available on this platform */
-
-
-/* float datatypes */
-typedef float float32;
-/* typedef double float64; */ /* not available on this platform */
-
-/* boolean datatypes and values */
-typedef char bool; /* TODO: bool, Bool, Boolean, and boolean are already defined in some platforms*/
-typedef bool boolean;
-#ifndef TRUE
- #define TRUE 1
-#endif
-#ifndef FALSE
- #define FALSE 0
-#endif
-
-/*
- * typedefs for eTrice Runtime and Testing
- *
- * */
-
-typedef int8 etInt8;
-typedef int16 etInt16;
-typedef int32 etInt32;
-
-typedef uint8 etUInt8;
-typedef uint16 etUInt16;
-typedef uint32 etUInt32;
-
-typedef bool etBool;
-
-typedef float32 etFloat32;
-
-typedef FILE* etFileHandle;
-
-typedef int8 etAddressId;
-
-#endif /* _DATATYPES_H_ */
+/*******************************************************************************
+ * Copyright (c) 2011 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+#ifndef _ETDATATYPES_H_
+#define _ETDATATYPES_H_
+
+/*
+ * typedefs for platform specific datatypes
+ * Version for TI MSP 430
+ *
+ * */
+
+#include <stdio.h>
+
+/* unsigned integer datatypes */
+typedef unsigned char uint8;
+typedef unsigned short int uint16;
+typedef unsigned long uint32;
+/* typedef unsigned long long uint64; */ /* not available on this platform */
+
+/* signed integer datatypes */
+typedef char int8;
+typedef short int int16;
+typedef long int32;
+/* typedef long long int64; */ /* not available on this platform */
+
+
+/* float datatypes */
+typedef float float32;
+/* typedef double float64; */ /* not available on this platform */
+
+/* boolean datatypes and values */
+typedef char bool; /* TODO: bool, Bool, Boolean, and boolean are already defined in some platforms*/
+typedef bool boolean;
+#ifndef TRUE
+ #define TRUE 1
+#endif
+#ifndef FALSE
+ #define FALSE 0
+#endif
+
+/*
+ * typedefs for eTrice Runtime and Testing
+ *
+ * */
+
+typedef int8 etInt8;
+typedef int16 etInt16;
+typedef int32 etInt32;
+
+typedef uint8 etUInt8;
+typedef uint16 etUInt16;
+typedef uint32 etUInt32;
+
+typedef bool etBool;
+
+typedef float32 etFloat32;
+
+typedef FILE* etFileHandle;
+
+typedef int8 etAddressId;
+
+#endif /* _DATATYPES_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etGlobalFlags.h b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etGlobalFlags.h
index 84213de5e..90105e67f 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etGlobalFlags.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etGlobalFlags.h
@@ -1,22 +1,22 @@
-/*******************************************************************************
- * Copyright (c) 2012 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 (initial contribution)
- *
- *******************************************************************************/
-
-#ifndef ETGLOBALFLAGS_H_
-#define ETGLOBALFLAGS_H_
-
-/* flags for debugging */
-#define ET_MSC_LOGGER_ACTIVATE /* needs ET_LOGGER_ACTIVATE */
-#define ET_LOGGER_ACTIVATE
-
-
-
-#endif /* ETGLOBALFLAGS_H_ */
+/*******************************************************************************
+ * Copyright (c) 2012 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+#ifndef ETGLOBALFLAGS_H_
+#define ETGLOBALFLAGS_H_
+
+/* flags for debugging */
+#define ET_MSC_LOGGER_ACTIVATE /* needs ET_LOGGER_ACTIVATE */
+#define ET_LOGGER_ACTIVATE
+
+
+
+#endif /* ETGLOBALFLAGS_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etLogger.c b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etLogger.c
index 9b20f31a3..d43a953ba 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etLogger.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etLogger.c
@@ -1,78 +1,78 @@
-/*******************************************************************************
- * Copyright (c) 2011 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 (initial contribution)
- *
- *******************************************************************************/
-
-/*
- * etLogger.c
- *
- * Created on: 16.01.2012
- * Author: tschuetz
- */
-
-
-#include "debugging/etLogger.h"
-
-#include <stdarg.h>
-
-
-void etLogger_logError(const char* message){
- printf("ERROR: %s\n", message);
-}
-
-void etLogger_logWarning(const char* message){
- printf("WARNING: %s\n", message);
-}
-
-void etLogger_logInfo(const char* message){
- printf("INFO: %s\n", message);
-}
-
-void etLogger_logErrorF(const char* format, ... ){
- printf("ERROR: ");
- va_list arglist;
- va_start( arglist, format );
- vprintf( format, arglist );
- va_end( arglist );
- printf("\n");
-}
-
-void etLogger_logWarningF(const char* format, ... ){
- printf("WARNING: ");
- va_list arglist;
- va_start( arglist, format );
- vprintf( format, arglist );
- va_end( arglist );
- printf("\n");
-}
-
-void etLogger_logInfoF(const char* format, ... ){
- printf("INFO: ");
- va_list arglist;
- va_start( arglist, format );
- vprintf( format, arglist );
- va_end( arglist );
- printf("\n");
-}
-
-etFileHandle etLogger_fopen(const char* filename, const char* mode){
- return( fopen(filename, mode) );
-}
-
-int etLogger_fclose(etFileHandle file){
- return( fclose(file) );
-}
-
-void etLogger_fprintf(etFileHandle file, const char* format, ... ){
- va_list arglist;
- va_start( arglist, format );
- vfprintf(file, format, arglist );
- va_end( arglist );
-}
+/*******************************************************************************
+ * Copyright (c) 2011 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+/*
+ * etLogger.c
+ *
+ * Created on: 16.01.2012
+ * Author: tschuetz
+ */
+
+
+#include "debugging/etLogger.h"
+
+#include <stdarg.h>
+
+
+void etLogger_logError(const char* message){
+ printf("ERROR: %s\n", message);
+}
+
+void etLogger_logWarning(const char* message){
+ printf("WARNING: %s\n", message);
+}
+
+void etLogger_logInfo(const char* message){
+ printf("INFO: %s\n", message);
+}
+
+void etLogger_logErrorF(const char* format, ... ){
+ printf("ERROR: ");
+ va_list arglist;
+ va_start( arglist, format );
+ vprintf( format, arglist );
+ va_end( arglist );
+ printf("\n");
+}
+
+void etLogger_logWarningF(const char* format, ... ){
+ printf("WARNING: ");
+ va_list arglist;
+ va_start( arglist, format );
+ vprintf( format, arglist );
+ va_end( arglist );
+ printf("\n");
+}
+
+void etLogger_logInfoF(const char* format, ... ){
+ printf("INFO: ");
+ va_list arglist;
+ va_start( arglist, format );
+ vprintf( format, arglist );
+ va_end( arglist );
+ printf("\n");
+}
+
+etFileHandle etLogger_fopen(const char* filename, const char* mode){
+ return( fopen(filename, mode) );
+}
+
+int etLogger_fclose(etFileHandle file){
+ return( fclose(file) );
+}
+
+void etLogger_fprintf(etFileHandle file, const char* format, ... ){
+ va_list arglist;
+ va_start( arglist, format );
+ vfprintf(file, format, arglist );
+ va_end( arglist );
+}
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etPlatform.c b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etPlatform.c
index 80ba0cfb3..e3265ad0a 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etPlatform.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etPlatform.c
@@ -1,83 +1,83 @@
-/*******************************************************************************
- * Copyright (c) 2012 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 (initial contribution)
- *
- *******************************************************************************/
-
-#include "msp430f5438a.h"
-#include "hal_MSP-EXP430F5438.h"
-
-/* forward declarations */
-static void prvSetupHardware(void);
-void initIO(void);
-
-
-/* implemenatation for eTrice interfaces*/
-
-void etUserEntry(void){
- prvSetupHardware();
-}
-
-void etUserPreRun(void){
- //_enable_interrupt();
-}
-
-void etUserPostRun(void){ }
-void etUserExit(void){ }
-
-
-/* platform specific functions */
-
-static void prvSetupHardware(void) {
- /* Convert a Hz value to a KHz value, as required by the Init_FLL_Settle()
- function. */
- unsigned long ulCPU_Clock_KHz = (25000000UL / 1000UL );
-
- /* Disable the watchdog. */
- WDTCTL = WDTPW + 0x36;
-
- halBoardInit();
-
- LFXT_Start(XT1DRIVE_0);
- Init_FLL_Settle((unsigned short) ulCPU_Clock_KHz, 488);
-
- halButtonsInit(BUTTON_ALL);
- halButtonsInterruptEnable(BUTTON_SELECT);
-
- /* Initialise the LCD, but note that the backlight is not used as the
- library function uses timer A0 to modulate the backlight, and this file
- defines vApplicationSetupTimerInterrupt() to also use timer A0 to generate
- the tick interrupt. If the backlight is required, then change either the
- halLCD library or vApplicationSetupTimerInterrupt() to use a different
- timer. Timer A1 is used for the run time stats time base6. */
- halLcdInit();
- halLcdSetContrast(105);
- halLcdClearScreen();
- halLcdBackLightInit();
- halLcdSetBackLight(10);
-
- halLcdPrintLine(" eTrice on MSP430", 1, OVERWRITE_TEXT);
-
- //initIO();
-}
-
-
-#pragma INTERRUPT(wdt_isr)
-#pragma vector=WDT_VECTOR
-void wdt_isr(void) {
-// this interrupt will be called every 15,625ms
- static unsigned char secCounter = 0;
-
- secCounter++;
-
- if (secCounter >= 64) {
- secCounter = 0;
- P1OUT ^= 0x01;
- }
-} // end interrupt
+/*******************************************************************************
+ * Copyright (c) 2012 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+#include "msp430f5438a.h"
+#include "hal_MSP-EXP430F5438.h"
+
+/* forward declarations */
+static void prvSetupHardware(void);
+void initIO(void);
+
+
+/* implemenatation for eTrice interfaces*/
+
+void etUserEntry(void){
+ prvSetupHardware();
+}
+
+void etUserPreRun(void){
+ //_enable_interrupt();
+}
+
+void etUserPostRun(void){ }
+void etUserExit(void){ }
+
+
+/* platform specific functions */
+
+static void prvSetupHardware(void) {
+ /* Convert a Hz value to a KHz value, as required by the Init_FLL_Settle()
+ function. */
+ unsigned long ulCPU_Clock_KHz = (25000000UL / 1000UL );
+
+ /* Disable the watchdog. */
+ WDTCTL = WDTPW + 0x36;
+
+ halBoardInit();
+
+ LFXT_Start(XT1DRIVE_0);
+ Init_FLL_Settle((unsigned short) ulCPU_Clock_KHz, 488);
+
+ halButtonsInit(BUTTON_ALL);
+ halButtonsInterruptEnable(BUTTON_SELECT);
+
+ /* Initialise the LCD, but note that the backlight is not used as the
+ library function uses timer A0 to modulate the backlight, and this file
+ defines vApplicationSetupTimerInterrupt() to also use timer A0 to generate
+ the tick interrupt. If the backlight is required, then change either the
+ halLCD library or vApplicationSetupTimerInterrupt() to use a different
+ timer. Timer A1 is used for the run time stats time base6. */
+ halLcdInit();
+ halLcdSetContrast(105);
+ halLcdClearScreen();
+ halLcdBackLightInit();
+ halLcdSetBackLight(10);
+
+ halLcdPrintLine(" eTrice on MSP430", 1, OVERWRITE_TEXT);
+
+ //initIO();
+}
+
+
+#pragma INTERRUPT(wdt_isr)
+#pragma vector=WDT_VECTOR
+void wdt_isr(void) {
+// this interrupt will be called every 15,625ms
+ static unsigned char secCounter = 0;
+
+ secCounter++;
+
+ if (secCounter >= 64) {
+ secCounter = 0;
+ P1OUT ^= 0x01;
+ }
+} // end interrupt
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/info.txt b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/info.txt
index b8f84e38c..71c5f9f3f 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/info.txt
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/info.txt
@@ -1 +1 @@
-TI-MSP430
+TI-MSP430
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etDatatypes.h b/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etDatatypes.h
index f49de7cf1..aac2ec338 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etDatatypes.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etDatatypes.h
@@ -1,73 +1,73 @@
-/*******************************************************************************
- * Copyright (c) 2011 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 (initial contribution)
- *
- *******************************************************************************/
-
-#ifndef _ETDATATYPES_H_
-#define _ETDATATYPES_H_
-
-/*
- * typedefs for platform specific datatypes
- * generic Version for most bigger 32 and 64 bit platforms like Linux an Windows
- *
- * */
-
-#include <stdio.h>
-
-/* unsigned integer datatypes */
-typedef unsigned char uint8;
-typedef unsigned short int uint16;
-typedef unsigned long uint32;
-typedef unsigned long long uint64;
-
-/* signed integer datatypes */
-typedef char int8;
-typedef short int int16;
-typedef long int32;
-typedef long long int64;
-
-
-/* float datatypes */
-typedef float float32;
-typedef double float64;
-
-/* boolean datatypes and values */
-typedef char bool; /* TODO: bool, Bool, Boolean, and boolean are already defined in some platforms*/
-typedef bool boolean;
-#ifndef TRUE
- #define TRUE 1
-#endif
-#ifndef FALSE
- #define FALSE 0
-#endif
-
-/*
- * typedefs for eTrice Runtime and Testing
- *
- * */
-
-typedef int8 etInt8;
-typedef int16 etInt16;
-typedef int32 etInt32;
-
-typedef uint8 etUInt8;
-typedef uint16 etUInt16;
-typedef uint32 etUInt32;
-
-typedef bool etBool;
-
-typedef float32 etFloat32;
-typedef float64 etFloat64;
-
-typedef FILE* etFileHandle;
-
-typedef int8 etAddressId;
-
-#endif /* _DATATYPES_H_ */
+/*******************************************************************************
+ * Copyright (c) 2011 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+#ifndef _ETDATATYPES_H_
+#define _ETDATATYPES_H_
+
+/*
+ * typedefs for platform specific datatypes
+ * generic Version for most bigger 32 and 64 bit platforms like Linux an Windows
+ *
+ * */
+
+#include <stdio.h>
+
+/* unsigned integer datatypes */
+typedef unsigned char uint8;
+typedef unsigned short int uint16;
+typedef unsigned long uint32;
+typedef unsigned long long uint64;
+
+/* signed integer datatypes */
+typedef char int8;
+typedef short int int16;
+typedef long int32;
+typedef long long int64;
+
+
+/* float datatypes */
+typedef float float32;
+typedef double float64;
+
+/* boolean datatypes and values */
+typedef char bool; /* TODO: bool, Bool, Boolean, and boolean are already defined in some platforms*/
+typedef bool boolean;
+#ifndef TRUE
+ #define TRUE 1
+#endif
+#ifndef FALSE
+ #define FALSE 0
+#endif
+
+/*
+ * typedefs for eTrice Runtime and Testing
+ *
+ * */
+
+typedef int8 etInt8;
+typedef int16 etInt16;
+typedef int32 etInt32;
+
+typedef uint8 etUInt8;
+typedef uint16 etUInt16;
+typedef uint32 etUInt32;
+
+typedef bool etBool;
+
+typedef float32 etFloat32;
+typedef float64 etFloat64;
+
+typedef FILE* etFileHandle;
+
+typedef int8 etAddressId;
+
+#endif /* _DATATYPES_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etGlobalFlags.h b/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etGlobalFlags.h
index 84213de5e..647dbab9b 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etGlobalFlags.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etGlobalFlags.h
@@ -1,22 +1,24 @@
-/*******************************************************************************
- * Copyright (c) 2012 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 (initial contribution)
- *
- *******************************************************************************/
-
-#ifndef ETGLOBALFLAGS_H_
-#define ETGLOBALFLAGS_H_
-
-/* flags for debugging */
-#define ET_MSC_LOGGER_ACTIVATE /* needs ET_LOGGER_ACTIVATE */
-#define ET_LOGGER_ACTIVATE
-
-
-
-#endif /* ETGLOBALFLAGS_H_ */
+/*******************************************************************************
+ * Copyright (c) 2012 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+#ifndef ETGLOBALFLAGS_H_
+#define ETGLOBALFLAGS_H_
+
+/* flags for debugging */
+#define ET_MSC_LOGGER_ACTIVATE /* needs ET_LOGGER_ACTIVATE */
+#define ET_LOGGER_ACTIVATE
+
+
+#define STRUCT_ALIGN 8
+
+
+#endif /* ETGLOBALFLAGS_H_ */
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etLogger.c b/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etLogger.c
index 47af50672..f68276960 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etLogger.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etLogger.c
@@ -1,70 +1,70 @@
-/*******************************************************************************
- * Copyright (c) 2011 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 (initial contribution)
- *
- *******************************************************************************/
-
-#include "debugging/etLogger.h"
-
-#include <stdarg.h>
-
-
-void etLogger_logError(const char* message){
- printf("ERROR: %s\n", message);
-}
-
-void etLogger_logWarning(const char* message){
- printf("WARNING: %s\n", message);
-}
-
-void etLogger_logInfo(const char* message){
- printf("INFO: %s\n", message);
-}
-
-void etLogger_logErrorF(const char* format, ... ){
- printf("ERROR: ");
- va_list arglist;
- va_start( arglist, format );
- vprintf( format, arglist );
- va_end( arglist );
- printf("\n");
-}
-
-void etLogger_logWarningF(const char* format, ... ){
- printf("WARNING: ");
- va_list arglist;
- va_start( arglist, format );
- vprintf( format, arglist );
- va_end( arglist );
- printf("\n");
-}
-
-void etLogger_logInfoF(const char* format, ... ){
- printf("INFO: ");
- va_list arglist;
- va_start( arglist, format );
- vprintf( format, arglist );
- va_end( arglist );
- printf("\n");
-}
-
-etFileHandle etLogger_fopen(const char* filename, const char* mode){
- return( fopen(filename, mode) );
-}
-
-int etLogger_fclose(etFileHandle file){
- return( fclose(file) );
-}
-
-void etLogger_fprintf(etFileHandle file, const char* format, ... ){
- va_list arglist;
- va_start( arglist, format );
- vfprintf(file, format, arglist );
- va_end( arglist );
-}
+/*******************************************************************************
+ * Copyright (c) 2011 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+#include "debugging/etLogger.h"
+
+#include <stdarg.h>
+
+
+void etLogger_logError(const char* message){
+ printf("ERROR: %s\n", message);
+}
+
+void etLogger_logWarning(const char* message){
+ printf("WARNING: %s\n", message);
+}
+
+void etLogger_logInfo(const char* message){
+ printf("INFO: %s\n", message);
+}
+
+void etLogger_logErrorF(const char* format, ... ){
+ printf("ERROR: ");
+ va_list arglist;
+ va_start( arglist, format );
+ vprintf( format, arglist );
+ va_end( arglist );
+ printf("\n");
+}
+
+void etLogger_logWarningF(const char* format, ... ){
+ printf("WARNING: ");
+ va_list arglist;
+ va_start( arglist, format );
+ vprintf( format, arglist );
+ va_end( arglist );
+ printf("\n");
+}
+
+void etLogger_logInfoF(const char* format, ... ){
+ printf("INFO: ");
+ va_list arglist;
+ va_start( arglist, format );
+ vprintf( format, arglist );
+ va_end( arglist );
+ printf("\n");
+}
+
+etFileHandle etLogger_fopen(const char* filename, const char* mode){
+ return( fopen(filename, mode) );
+}
+
+int etLogger_fclose(etFileHandle file){
+ return( fclose(file) );
+}
+
+void etLogger_fprintf(etFileHandle file, const char* format, ... ){
+ va_list arglist;
+ va_start( arglist, format );
+ vfprintf(file, format, arglist );
+ va_end( arglist );
+}
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etPlatform.c b/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etPlatform.c
index f8294f036..5a4115f8c 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etPlatform.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etPlatform.c
@@ -1,26 +1,26 @@
-/*******************************************************************************
- * Copyright (c) 2012 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 (initial contribution)
- *
- *******************************************************************************/
-
-
-/* implemenatation for eTrice interfaces*/
-
-void etUserEntry(void){ }
-
-void etUserPreRun(void){ }
-
-void etUserPostRun(void){ }
-
-void etUserExit(void){ }
-
-
-/* platform specific functions */
-
+/*******************************************************************************
+ * Copyright (c) 2012 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 (initial contribution)
+ *
+ *******************************************************************************/
+
+
+/* implemenatation for eTrice interfaces*/
+
+void etUserEntry(void){ }
+
+void etUserPreRun(void){ }
+
+void etUserPostRun(void){ }
+
+void etUserExit(void){ }
+
+
+/* platform specific functions */
+
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/info.txt b/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/info.txt
index bcb721d20..a2ac1f6d4 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/info.txt
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/info.txt
@@ -1,2 +1,2 @@
-This generic platform can be used for most 32 or 64 bit systems like windows and linux.
-It uses standard c libraries only and it makes use of the file system.
+This generic platform can be used for most 32 or 64 bit systems like windows and linux.
+It uses standard c libraries only and it makes use of the file system.

Back to the top