Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef')
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.c21
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.h50
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.c7
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.h13
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.c7
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.h13
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys.c42
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys.h27
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys_Runner.c37
9 files changed, 140 insertions, 77 deletions
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.c
deleted file mode 100644
index 22bc04cec..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include "CommunicationProtocol.h"
-
-/*--------------------- port classes */
-
-
-
-/*--------------------- debug helpers */
-
-/* TODO: make this optional or different for smaller footprint */
-/* message names as strings for debugging (generate MSC) */
-static const char* CommunicationProtocol_messageStrings[] = {"MIN", "receivedData","sendData", "sendData2", "MAX"};
-
-const char* CommunicationProtocol_getMessageString(int msg_id) {
- if (msg_id<CommunicationProtocol_MSG_MIN || msg_id>CommunicationProtocol_MSG_MAX+1){
- /* id out of range */
- return "Message ID out of range";
- }
- else{
- return CommunicationProtocol_messageStrings[msg_id];
- }
-}
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.h
deleted file mode 100644
index df506543c..000000000
--- a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.h
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef _CommunicationProtocol_H_
-#define _CommunicationProtocol_H_
-
-#include "etDatatypes.h"
-
-
-#include "DataClass1.h"
-
-typedef struct {
-
-
-} CommunicationProtocol;
-
-/* message IDs */
-enum {
- CommunicationProtocol_MSG_MIN = 0,
- /* IDs for outgoing messages */
- CommunicationProtocol_OUT_receivedData = 1,
- /* IDs for incoming messages */
- CommunicationProtocol_IN_sendData = 2,
- CommunicationProtocol_IN_sendData2 = 3,
- /* error if msgID >= MSG_MAX */
- CommunicationProtocol_MSG_MAX = 4
-};
-
-/*--------------------- port classes */
-
-typedef etPort CommunicationProtocolPort;
-
-void CommunicationProtocolPort_MyOperation1(CommunicationProtocolPort* self, int a, int b)
-int CommunicationProtocolPort_MyOperation2(CommunicationProtocolPort* self)
-
-
-
-typedef etPort CommunicationProtocolConjPort;
-
-void CommunicationProtocolConjPort_MyOperation1(CommunicationProtocolConjPort* self, int a, int b)
-int CommunicationProtocolConjPort_MyOperation2(CommunicationProtocolConjPort* self)
-
-
-
-/*--------------------- debug helpers */
-
-/* get message string for message id */
-const char* CommunicationProtocol_getMessageString(int msg_id);
-
-
-
-#endif /* _CommunicationProtocol_H_ */
-
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.c
index d4235dbc3..d66aaaae4 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.c
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.c
@@ -1,3 +1,10 @@
+/**
+ * @author generated by eTrice
+ *
+ * Source File of DataClass DataClass1
+ *
+ */
+
#include "DataClass1.h"
#include <string.h>
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.h
index dbf8dee81..c9ffdba2b 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.h
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass1.h
@@ -1,5 +1,12 @@
-#ifndef _DataClass1_H_
-#define _DataClass1_H_
+/**
+ * @author generated by eTrice
+ *
+ * Header File of DataClass DataClass1
+ *
+ */
+
+#ifndef _DATACLASS1_H_
+#define _DATACLASS1_H_
#include "etDatatypes.h"
@@ -29,5 +36,5 @@ float32 DataClass1_MultiplyWithAttr3(DataClass1* self, float32 value);
// deep copy
void DataClass1_deepCopy(DataClass1* source, DataClass1* target);
-#endif /* _DataClass1_H_ */
+#endif /* _DATACLASS1_H_ */
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.c
index 2150d7b41..6445aa75a 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.c
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.c
@@ -1,3 +1,10 @@
+/**
+ * @author generated by eTrice
+ *
+ * Source File of DataClass DataClass2
+ *
+ */
+
#include "DataClass2.h"
#include <string.h>
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.h
index 2d8cbb74f..dc3dd8c7c 100644
--- a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.h
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/DataClass2.h
@@ -1,5 +1,12 @@
-#ifndef _DataClass2_H_
-#define _DataClass2_H_
+/**
+ * @author generated by eTrice
+ *
+ * Header File of DataClass DataClass2
+ *
+ */
+
+#ifndef _DATACLASS2_H_
+#define _DATACLASS2_H_
#include "etDatatypes.h"
@@ -21,5 +28,5 @@ void DataClass2_Operation1(DataClass2* self);
// deep copy
void DataClass2_deepCopy(DataClass2* source, DataClass2* target);
-#endif /* _DataClass2_H_ */
+#endif /* _DATACLASS2_H_ */
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys.c
new file mode 100644
index 000000000..2f406e75c
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys.c
@@ -0,0 +1,42 @@
+/**
+ * @author generated by eTrice
+ *
+ * Source File of SubSystemClass SubSys
+ *
+ */
+
+#include "SubSys.h"
+
+#include "etLogger.h"
+
+/* data for SubSysten SubSys */
+typedef struct SubSys {
+ char *name;
+} SubSys;
+
+static SubSys SubSysInst = {"SubSys"};
+
+void SubSys_init(void){
+ etLogger_logInfoF("%s_init", SubSysInst.name);
+}
+
+void SubSys_start(void){
+ etLogger_logInfoF("%s_start", SubSysInst.name);
+}
+
+void SubSys_run(void){
+ int32 i;
+ for (i=0; i<100; i++){
+ etLogger_logInfoF("%s Scheduler tick %d", SubSysInst.name, i);
+ }
+}
+
+void SubSys_stop(void){
+ etLogger_logInfoF("%s_stop", SubSysInst.name);
+}
+
+void SubSys_destroy(void){
+ etLogger_logInfoF("%s_destroy", SubSysInst.name);
+}
+
+
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys.h
new file mode 100644
index 000000000..1a7674395
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys.h
@@ -0,0 +1,27 @@
+/**
+ * @author generated by eTrice
+ *
+ * Header File of SubSystemClass SubSys
+ *
+ */
+
+#ifndef _SUBSYS_H_
+#define _SUBSYS_H_
+
+
+/* lifecycle functions
+ * init -> start -> run (loop) -> stop -> destroy
+ */
+
+void SubSys_init(void); // lifecycle init
+void SubSys_start(void); // lifecycle start
+
+void SubSys_run(void);
+
+void SubSys_stop(void); // lifecycle stop
+void SubSys_destroy(void); // lifecycle destroy
+
+
+#endif /* _SUBSYS_H_ */
+
+
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys_Runner.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys_Runner.c
new file mode 100644
index 000000000..845779756
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys_Runner.c
@@ -0,0 +1,37 @@
+/**
+ * @author generated by eTrice
+ *
+ * this class contains the main function running component SubSys
+ * it instantiates SubSys and starts and ends the lifecycle
+ */
+
+
+#include "SubSys.h"
+
+#include "etLogger.h"
+
+/**
+ * main function
+ * creates component and starts and stops the lifecycle
+ */
+
+int main(void) {
+
+ etLogger_logInfo("*** T H E B E G I N ***");
+
+ /* startup sequence of lifecycle */
+ SubSys_init(); /* lifecycle init */
+ SubSys_start(); /* lifecycle start */
+
+ /* run Scheduler */
+ SubSys_run();
+
+ /* shutdown sequence of lifecycle */
+ SubSys_stop(); /* lifecycle stop */
+ SubSys_destroy(); /* lifecycle destroy */
+
+ etLogger_logInfo("*** T H E E N D ***");
+
+ return 0;
+}
+

Back to the top