summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortjung2012-05-17 09:08:47 (EDT)
committertjung2012-05-17 09:08:47 (EDT)
commitd854a849b32f81814ca61623a38cee2cca417b8e (patch)
tree09ae5012cd62dd228e8bc2a4478ca2cfdcf7b509
parenta5632a4ad02a1aa2fb5e1640d7ba3185f2857da3 (diff)
downloadorg.eclipse.etrice-d854a849b32f81814ca61623a38cee2cca417b8e.zip
org.eclipse.etrice-d854a849b32f81814ca61623a38cee2cca417b8e.tar.gz
org.eclipse.etrice-d854a849b32f81814ca61623a38cee2cca417b8e.tar.bz2
[runtime.c] some changes for Timing Service / Timingservice fixed
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/platform/etTimer.h5
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etPlatform.c35
-rw-r--r--tests/org.eclipse.etrice.generator.c.tests/model/TimingServiceC.room2
3 files changed, 41 insertions, 1 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/platform/etTimer.h b/runtime/org.eclipse.etrice.runtime.c/src/common/platform/etTimer.h
index a3cc3fb..2e89abe 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/platform/etTimer.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/platform/etTimer.h
@@ -1,3 +1,6 @@
+#ifndef _ETTIMER_H_
+#define _ETTIMER_H_
+
#include "etDatatypes.h"
@@ -22,3 +25,5 @@ uint32 getTimeBaseNS(void);
uint32 getTimeBaseUS(void);
uint32 getTimeBaseMS(void);
+
+#endif /* ETTIMER_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
index 9dec5c0..1650cd8 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
@@ -49,9 +49,44 @@ static void prvSetupHardware(void) {
/* select port pin functions */
halBoardInit();
+ P1DIR |= 0x03;
+ P2DIR &= ~0xC0;
+ P2REN |= 0xC0;
+ P2OUT |= 0xC0;
+
LFXT_Start(XT1DRIVE_0); /* enable oszillator */
Init_FLL_Settle((unsigned short) ulCPU_Clock_KHz, 488); /* clock divisor */
}
+unsigned char getButtonStatus(unsigned int id){
+ switch (id){
+ case 1:return P2IN & 0x80;
+ break;
+ case 2:return P2IN & 0x40;
+ break;
+ default: return 0xFF;
+ };
+}
+
+void setLedPin (unsigned int id, unsigned int onOff){
+ switch (id){
+ case 1:
+ if (onOff){
+ P1OUT |= 0x01;
+ }else{
+ P1OUT &= ~0x01;
+ }
+ break;
+ case 2:
+ if (onOff){
+ P1OUT |= 0x02;
+ }else{
+ P1OUT &= ~0x02;
+ }
+ break;
+ default:
+ }
+}
+
diff --git a/tests/org.eclipse.etrice.generator.c.tests/model/TimingServiceC.room b/tests/org.eclipse.etrice.generator.c.tests/model/TimingServiceC.room
index 4e88e9a..76163d9 100644
--- a/tests/org.eclipse.etrice.generator.c.tests/model/TimingServiceC.room
+++ b/tests/org.eclipse.etrice.generator.c.tests/model/TimingServiceC.room
@@ -91,7 +91,7 @@ RoomModel room.basic.service.timingC {
}else{
// right position found
block->next=temp;
- if(temp2==usedTcbsRoot){
+ if(temp==usedTcbsRoot){
usedTcbsRoot=block;
}else{
temp2->next=block;