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.h (renamed from runtime/org.eclipse.etrice.runtime.c/src/etLogger.h)0
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etMSCLogger.c (renamed from runtime/org.eclipse.etrice.runtime.c/src/etMSCLogger.c)4
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etMSCLogger.h (renamed from runtime/org.eclipse.etrice.runtime.c/src/etMSCLogger.h)2
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c (renamed from runtime/org.eclipse.etrice.runtime.c/src/etUnit.c)16
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h (renamed from runtime/org.eclipse.etrice.runtime.c/src/etUnit.h)1
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessage.c (renamed from runtime/org.eclipse.etrice.runtime.c/src/etMessage.c)4
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessage.h (renamed from runtime/org.eclipse.etrice.runtime.c/src/etMessage.h)0
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.c (renamed from runtime/org.eclipse.etrice.runtime.c/src/etMessageQueue.c)4
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.h (renamed from runtime/org.eclipse.etrice.runtime.c/src/etMessageQueue.h)2
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageReceiver.h (renamed from runtime/org.eclipse.etrice.runtime.c/src/etMessageReceiver.h)2
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageService.c (renamed from runtime/org.eclipse.etrice.runtime.c/src/etMessageService.c)4
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageService.h (renamed from runtime/org.eclipse.etrice.runtime.c/src/etMessageService.h)4
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etActor.c (renamed from runtime/org.eclipse.etrice.runtime.c/src/etActor.c)2
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etActor.h (renamed from runtime/org.eclipse.etrice.runtime.c/src/etActor.h)4
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etPort.c (renamed from runtime/org.eclipse.etrice.runtime.c/src/etPort.c)25
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etPort.h (renamed from runtime/org.eclipse.etrice.runtime.c/src/etPort.h)8
-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.h27
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etDatatypes.h72
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etGlobalFlags.h22
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etLogger.c (renamed from runtime/org.eclipse.etrice.runtime.c/src/etLogger.c)2
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etPlatform.c83
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/info.txt1
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etDatatypes.h (renamed from runtime/org.eclipse.etrice.runtime.c/src/etDatatypes.h)1
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etGlobalFlags.h24
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etLogger.c70
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etPlatform.c26
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/info.txt2
28 files changed, 402 insertions, 39 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etLogger.h b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.h
index 6c46889a8..6c46889a8 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etLogger.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etLogger.h
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etMSCLogger.c b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etMSCLogger.c
index 9abc9be9d..4596292a7 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etMSCLogger.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etMSCLogger.c
@@ -10,9 +10,9 @@
*
*******************************************************************************/
-#include "etMSCLogger.h"
+#include "debugging/etMSCLogger.h"
-#include "etLogger.h"
+#include "debugging/etLogger.h"
static etFileHandle etMSCLogger_fileHandle = NULL;
static char* etMSCLogger_objectName = "";
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etMSCLogger.h b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etMSCLogger.h
index af78894bd..b1720cec5 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etMSCLogger.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/debugging/etMSCLogger.h
@@ -13,7 +13,7 @@
#ifndef _ETMSCLOGGER_H_
#define _ETMSCLOGGER_H_
-#define ET_MSC_LOGGER_ACTIVATE
+#include "etGlobalFlags.h"
void etMSCLogger_open(char* logPath, char* mscName);
void etMSCLogger_close(void);
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etUnit.c b/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c
index f9a963664..4facacbcd 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etUnit.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c
@@ -10,10 +10,10 @@
*
*******************************************************************************/
-#include "etUnit.h"
+#include "etUnit/etUnit.h"
#include <string.h>
#include <time.h>
-#include "etLogger.h"
+#include "debugging/etLogger.h"
/*** member variables */
@@ -47,7 +47,7 @@ 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, etFloat64 expected, etFloat64 actual, etFloat64 precision);
+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);
@@ -192,11 +192,7 @@ void EXPECT_EQUAL_UINT32(const char* message, etUInt32 expected, etUInt32 actual
void EXPECT_EQUAL_FLOAT32(const char* message, etFloat32 expected, etFloat32 actual, etFloat32 precision) {
- expect_equal_float(message, (etFloat64) expected, (etFloat64) actual, (etFloat64) precision);
-}
-
-void EXPECT_EQUAL_FLOAT64(const char* message, etFloat64 expected, etFloat64 actual, etFloat64 precision) {
- expect_equal_float(message, (etFloat64) expected, (etFloat64) actual, (etFloat64) precision);
+ expect_equal_float(message, expected, actual, precision);
}
/* order */
@@ -262,10 +258,10 @@ void expect_equal_uint(const char* message, etUInt32 expected, etUInt32 actual)
}
-void expect_equal_float(const char* message, etFloat64 expected, etFloat64 actual, etFloat64 precision) {
+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=%lf, actual=%lf", message, expected, actual);
+ sprintf(testresult, "%s: expected=%f, actual=%f", message, expected, actual);
etUnit_handleExpect(FALSE, testresult);
} else {
etUnit_handleExpect(TRUE, "");
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etUnit.h b/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h
index 34284c541..5daa4aa95 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etUnit.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h
@@ -45,7 +45,6 @@ void EXPECT_EQUAL_UINT32(const char* testcase, etUInt32 expected, etUInt32 actua
/* float values */
void EXPECT_EQUAL_FLOAT32(const char* testcase, etFloat32 expected, etFloat32 actual, etFloat32 precision);
-void EXPECT_EQUAL_FLOAT64(const char* testcase, etFloat64 expected, etFloat64 actual, etFloat64 precision);
/* Pointers */
#define EXPECT_EQUAL_PTR(testcase, expected, actual) \
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etMessage.c b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessage.c
index 146467c23..49772f7b6 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etMessage.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessage.c
@@ -10,9 +10,9 @@
*
*******************************************************************************/
-#include "etMessage.h"
+#include "messaging/etMessage.h"
-#include "etMSCLogger.h"
+#include "debugging/etMSCLogger.h"
#include <stddef.h>
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etMessage.h b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessage.h
index 698a89c09..698a89c09 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etMessage.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessage.h
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etMessageQueue.c b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.c
index 639798bc6..b1a5fea54 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etMessageQueue.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.c
@@ -10,9 +10,9 @@
*
*******************************************************************************/
-#include "etMessageQueue.h"
+#include "messaging/etMessageQueue.h"
-#include "etMSCLogger.h"
+#include "debugging/etMSCLogger.h"
void etMessageQueue_init(etMessageQueue* self){
ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "init")
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etMessageQueue.h b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.h
index a303146ec..f305d1aa9 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etMessageQueue.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageQueue.h
@@ -13,7 +13,7 @@
#ifndef _ETMESSAGEQUEUE_H_
#define _ETMESSAGEQUEUE_H_
-#include "etMessage.h"
+#include "messaging/etMessage.h"
#include <stddef.h>
typedef struct etMessageQueue {
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etMessageReceiver.h b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageReceiver.h
index c75686654..a1bd92ce2 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etMessageReceiver.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageReceiver.h
@@ -15,7 +15,7 @@
#ifndef _ETMESSAGERECEIVER_H_
#define _ETMESSAGERECEIVER_H_
-#include "etMessage.h"
+#include "messaging/etMessage.h"
typedef void (*etActorReceiveMessage)(void* self, void* ifitem, const etMessage* msg);
typedef void (*etDispatcherReceiveMessage)(const etMessage* msg);
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etMessageService.c b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageService.c
index 10e2fe00c..3755d2107 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etMessageService.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageService.c
@@ -14,8 +14,8 @@
#include "etMessageService.h"
-#include "etLogger.h"
-#include "etMSCLogger.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")
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etMessageService.h b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageService.h
index 5997363d1..0303bbf0c 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etMessageService.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/messaging/etMessageService.h
@@ -15,8 +15,8 @@
#include <stddef.h>
#include "etDatatypes.h"
-#include "etMessageQueue.h"
-#include "etMessageReceiver.h"
+#include "messaging/etMessageQueue.h"
+#include "messaging/etMessageReceiver.h"
typedef struct etBuffer{
etUInt8 *buffer;
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etActor.c b/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etActor.c
index 008a6474d..12d3808f0 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etActor.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etActor.c
@@ -10,7 +10,7 @@
*
*******************************************************************************/
-#include "etActor.h"
+#include "modelbase/etActor.h"
boolean handleSystemEvent(InterfaceItemBase ifitem, int evt, void* generic_data) {
/* TODO */
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etActor.h b/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etActor.h
index 5cd70f694..88b6178cd 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etActor.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etActor.h
@@ -13,8 +13,8 @@
#ifndef _ETACTOR_H_
#define _ETACTOR_H_
-#include "etDataTypes.h"
-#include "etPort.h"
+#include "etDatatypes.h"
+#include "modelbase/etPort.h"
#define NOT_CAUGHT 0
#define EVT_SHIFT 100
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etPort.c b/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etPort.c
index 24f22043d..90b0f19cb 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etPort.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etPort.c
@@ -10,9 +10,11 @@
*
*******************************************************************************/
-#include "etPort.h"
+#include "modelbase/etPort.h"
-#include "etMSCLogger.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")
@@ -22,9 +24,18 @@ void etPort_receive(const etPort* self, const etMessage* msg) {
}
-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);
+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/etPort.h b/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etPort.h
index 797adb9ad..49321065a 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etPort.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/modelbase/etPort.h
@@ -16,9 +16,9 @@
#define _ETPORT_H_
-#include "etMessage.h"
-#include "etMessageReceiver.h"
-#include "etMessageService.h"
+#include "messaging/etMessage.h"
+#include "messaging/etMessageReceiver.h"
+#include "messaging/etMessageService.h"
typedef struct {
void* myActor;
@@ -55,7 +55,7 @@ typedef struct {
typedef etPort* InterfaceItemBase;
void etPort_receive(const etPort* self, const etMessage* msg);
-void etPort_sendMessage(const etPort* self, etInt16 evtId);
+void etPort_sendMessage(const etPort* self, etInt16 evtId, int size, void* data);
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
new file mode 100644
index 000000000..1f3c17ec3
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/platform/etPlatform.h
@@ -0,0 +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);
+
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
new file mode 100644
index 000000000..a831f66ff
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etDatatypes.h
@@ -0,0 +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_ */
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
new file mode 100644
index 000000000..90105e67f
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etGlobalFlags.h
@@ -0,0 +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_ */
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etLogger.c b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etLogger.c
index 13c2fea0a..d43a953ba 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etLogger.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etLogger.c
@@ -18,7 +18,7 @@
*/
-#include "etLogger.h"
+#include "debugging/etLogger.h"
#include <stdarg.h>
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
new file mode 100644
index 000000000..e3265ad0a
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etPlatform.c
@@ -0,0 +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
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
new file mode 100644
index 000000000..71c5f9f3f
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/info.txt
@@ -0,0 +1 @@
+TI-MSP430
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/etDatatypes.h b/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etDatatypes.h
index bf161f396..aac2ec338 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/etDatatypes.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etDatatypes.h
@@ -15,6 +15,7 @@
/*
* typedefs for platform specific datatypes
+ * generic Version for most bigger 32 and 64 bit platforms like Linux an Windows
*
* */
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
new file mode 100644
index 000000000..647dbab9b
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etGlobalFlags.h
@@ -0,0 +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
+
+
+#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
new file mode 100644
index 000000000..f68276960
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etLogger.c
@@ -0,0 +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 );
+}
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
new file mode 100644
index 000000000..5a4115f8c
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/etPlatform.c
@@ -0,0 +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 */
+
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
new file mode 100644
index 000000000..a2ac1f6d4
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/generic/info.txt
@@ -0,0 +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.

Back to the top