Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortjung2012-05-17 13:08:47 +0000
committertjung2012-05-17 13:08:47 +0000
commitd854a849b32f81814ca61623a38cee2cca417b8e (patch)
tree09ae5012cd62dd228e8bc2a4478ca2cfdcf7b509 /runtime/org.eclipse.etrice.runtime.c/src/platforms
parenta5632a4ad02a1aa2fb5e1640d7ba3185f2857da3 (diff)
downloadorg.eclipse.etrice-d854a849b32f81814ca61623a38cee2cca417b8e.tar.gz
org.eclipse.etrice-d854a849b32f81814ca61623a38cee2cca417b8e.tar.xz
org.eclipse.etrice-d854a849b32f81814ca61623a38cee2cca417b8e.zip
[runtime.c] some changes for Timing Service / Timingservice fixed
Diffstat (limited to 'runtime/org.eclipse.etrice.runtime.c/src/platforms')
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/MSP430/etPlatform.c35
1 files changed, 35 insertions, 0 deletions
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 9dec5c084..1650cd8a4 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:
+ }
+}
+

Back to the top