Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Schuetz2012-01-31 16:25:45 -0500
committerThomas Schuetz2012-01-31 16:25:45 -0500
commit01de373df4a524f266ad4250ea54d9aa30299920 (patch)
treeea2f77be21334d9daaf0156986d25e1a3e5b0a6f /examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef
parent010759ae39852112ad533827402087c0e3daef59 (diff)
downloadorg.eclipse.etrice-01de373df4a524f266ad4250ea54d9aa30299920.tar.gz
org.eclipse.etrice-01de373df4a524f266ad4250ea54d9aa30299920.tar.xz
org.eclipse.etrice-01de373df4a524f266ad4250ea54d9aa30299920.zip
[generator.c] added const instances for ROM
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.c28
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.h49
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/ReceiverManual.c14
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/ReceiverManual.h38
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SenderManual.c14
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SenderManual.h39
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys.c7
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys.h10
-rw-r--r--examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys_Inst.h54
9 files changed, 248 insertions, 5 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
new file mode 100644
index 000000000..4ff412e02
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.c
@@ -0,0 +1,28 @@
+/**
+ * @author generated by eTrice
+ *
+ * Source File of ProtocolClass CommunicationProtocol
+ *
+ */
+
+#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
new file mode 100644
index 000000000..a600e07e8
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/CommunicationProtocol.h
@@ -0,0 +1,49 @@
+/**
+ * @author generated by eTrice
+ *
+ * Header File of ProtocolClass CommunicationProtocol
+ *
+ */
+
+#ifndef _COMMUNICATIONPROTOCOL_H_
+#define _COMMUNICATIONPROTOCOL_H_
+
+#include "etDatatypes.h"
+#include "etPort.h"
+
+
+#include "DataClass1.h"
+
+/* 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;
+
+
+
+
+typedef etPort CommunicationProtocolConjPort;
+
+
+
+
+/*--------------------- 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/ReceiverManual.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/ReceiverManual.c
new file mode 100644
index 000000000..aa5113e40
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/ReceiverManual.c
@@ -0,0 +1,14 @@
+/**
+ * @author generated by eTrice
+ *
+ * Source File of ActorClass ReceiverManual
+ *
+ */
+
+#include "ReceiverManual.h"
+
+
+void ReceiverManual_ReceiveMessage(void* self, etInt16 localId, const etMessage*){
+ etLogger_logInfoF("ReceiverManual_ReceiveMessage");
+}
+
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/ReceiverManual.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/ReceiverManual.h
new file mode 100644
index 000000000..a1d21b256
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/ReceiverManual.h
@@ -0,0 +1,38 @@
+/**
+ * @author generated by eTrice
+ *
+ * Header File of ActorClass ReceiverManual
+ *
+ */
+
+#ifndef _RECEIVERMANUAL_H_
+#define _RECEIVERMANUAL_H_
+
+#include "etDatatypes.h"
+
+
+#include "CommunicationProtocol.h"
+
+
+typedef struct ReceiverManual ReceiverManual;
+
+/* const part of ActorClass (ROM) */
+typedef struct ReceiverManual_const {
+ const ReceiverManual* actor;
+ /* Ports */
+ const CommunicationProtocolPort dataIn;
+
+} ReceiverManual_const;
+
+/* variable part of ActorClass (RAM) */
+struct ReceiverManual {
+ const ReceiverManual_const* constData;
+};
+
+void ReceiverManual_ReceiveMessage(void* self, etInt16 localId, const etMessage*);
+
+
+
+
+#endif /* _RECEIVERMANUAL_H_ */
+
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SenderManual.c b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SenderManual.c
new file mode 100644
index 000000000..0ba6959ee
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SenderManual.c
@@ -0,0 +1,14 @@
+/**
+ * @author generated by eTrice
+ *
+ * Source File of ActorClass SenderManual
+ *
+ */
+
+#include "SenderManual.h"
+
+
+void SenderManual_ReceiveMessage(void* self, etInt16 localId, const etMessage*){
+ etLogger_logInfoF("SenderManual_ReceiveMessage");
+}
+
diff --git a/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SenderManual.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SenderManual.h
new file mode 100644
index 000000000..b131993a7
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SenderManual.h
@@ -0,0 +1,39 @@
+/**
+ * @author generated by eTrice
+ *
+ * Header File of ActorClass SenderManual
+ *
+ */
+
+#ifndef _SENDERMANUAL_H_
+#define _SENDERMANUAL_H_
+
+#include "etDatatypes.h"
+
+#include "DataClass1.h"
+
+#include "CommunicationProtocol.h"
+
+
+typedef struct SenderManual SenderManual;
+
+/* const part of ActorClass (ROM) */
+typedef struct SenderManual_const {
+ const SenderManual* actor;
+ /* Ports */
+ const CommunicationProtocolConjPort dataOut;
+
+} SenderManual_const;
+
+/* variable part of ActorClass (RAM) */
+struct SenderManual {
+ const SenderManual_const* constData;
+};
+
+void SenderManual_ReceiveMessage(void* self, etInt16 localId, const etMessage*);
+
+
+
+
+#endif /* _SENDERMANUAL_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
index 2f406e75c..eca7b5290 100644
--- 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
@@ -7,6 +7,9 @@
#include "SubSys.h"
+/* include instances for all classes */
+#include "SubSys_Inst.h"
+
#include "etLogger.h"
/* data for SubSysten SubSys */
@@ -18,6 +21,10 @@ static SubSys SubSysInst = {"SubSys"};
void SubSys_init(void){
etLogger_logInfoF("%s_init", SubSysInst.name);
+
+ /* initialization of all message services */
+ etMessageService_init(&msgService_Thread1, msgBuffer_Thread1, MESSAGE_POOL_MAX, MESSAGE_BLOCK_SIZE);
+
}
void SubSys_start(void){
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
index 1a7674395..eee116929 100644
--- 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
@@ -13,13 +13,13 @@
* init -> start -> run (loop) -> stop -> destroy
*/
-void SubSys_init(void); // lifecycle init
-void SubSys_start(void); // lifecycle start
+void SubSys_init(void); /* lifecycle init */
+void SubSys_start(void); /* lifecycle start */
-void SubSys_run(void);
+void SubSys_run(void); /* lifecycle run */
-void SubSys_stop(void); // lifecycle stop
-void SubSys_destroy(void); // lifecycle destroy
+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_Inst.h b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys_Inst.h
new file mode 100644
index 000000000..2feae0971
--- /dev/null
+++ b/examples/org.eclipse.etrice.generator.c.reference/src-gen/cGenRef/SubSys_Inst.h
@@ -0,0 +1,54 @@
+/**
+ * @author generated by eTrice
+ *
+ * Instance File of SubSystemClass SubSys
+ * - instantiation of all actor instances and port instances
+ * - configuration of data and connection of ports
+ */
+
+#include "etMessageService.h"
+
+/* instantiation of message services */
+#define MESSAGE_POOL_MAX 10
+#define MESSAGE_BLOCK_SIZE 32
+/* MessageService for Thread1 */
+uint8 msgBuffer_Thread1[MESSAGE_POOL_MAX*MESSAGE_BLOCK_SIZE];
+etMessageService msgService_Thread1;
+
+
+/* include all used ActorClasses */
+/* TODO: only include used Actor Classes for current SubSystem */
+#include "SenderManual.h"
+#include "ReceiverManual.h"
+
+/* include all used ProtcolClasses */
+#include "CommunicationProtocol.h"
+
+
+/* declarations of all ActorClass instances (const and variable structs) */
+
+/* forward declaration of varible actor structs */
+static ReceiverManual _SubSys_Receiver;
+static SenderManual _SubSys_Sender;
+
+
+/* instance _SubSys_Receiver */
+static const ReceiverManual_const _SubSys_Receiver_const = {
+ &_SubSys_Receiver,
+ /* Ports: {myActor, etReceiveMessage, msgService, peerAddress, localId} */
+ {&_SubSys_Receiver, NULL, &msgService_Thread1, 1, 123} /* Port dataIn */
+
+};
+static ReceiverManual _SubSys_Receiver = {&_SubSys_Receiver_const};
+
+/* instance _SubSys_Sender */
+static const SenderManual_const _SubSys_Sender_const = {
+ &_SubSys_Sender,
+ /* Ports: {myActor, etReceiveMessage, msgService, peerAddress, localId} */
+ {&_SubSys_Sender, NULL, &msgService_Thread1, 1, 123} /* Port dataOut */
+
+};
+static SenderManual _SubSys_Sender = {&_SubSys_Sender_const};
+
+
+

Back to the top