Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad')
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etDatatypes.h144
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etLogger.c192
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etPlatform.c104
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etTimer.c138
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/info.txt2
5 files changed, 290 insertions, 290 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etDatatypes.h b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etDatatypes.h
index a831f66ff..aa948e6b4 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etDatatypes.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etDatatypes.h
@@ -1,72 +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_ */
+/*******************************************************************************
+ * 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/ST_MSP430_G2553_CCS5_LaunchPad/etLogger.c b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etLogger.c
index cf9543081..0ed0a557b 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etLogger.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etLogger.c
@@ -1,96 +1,96 @@
-/*******************************************************************************
- * 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)
- *
- *******************************************************************************/
-
-/*
- * etLogger.c
- *
- * Created on: 16.01.2012
- * Author: tschuetz
- */
-
-//#define ET_LOGGER_ACTIVATE 1
-#include "debugging/etLogger.h"
-
-#include <stdarg.h>
-
-
-void etLogger_logError(const char* message){
-#ifdef ET_LOGGER_ACTIVATE
- printf("ERROR: %s\n", message);
-#endif
-}
-
-void etLogger_logWarning(const char* message){
-#ifdef ET_LOGGER_ACTIVATE
- printf("WARNING: %s\n", message);
-#endif
-}
-
-void etLogger_logInfo(const char* message){
-#ifdef ET_LOGGER_ACTIVATE
- printf("INFO: %s\n", message);
-#endif
-}
-
-void etLogger_logErrorF(const char* format, ... ){
-#ifdef ET_LOGGER_ACTIVATE
- printf("ERROR: ");
- va_list arglist;
- va_start( arglist, format );
- vprintf( format, arglist );
- va_end( arglist );
- printf("\n");
-#endif
-}
-
-void etLogger_logWarningF(const char* format, ... ){
-#ifdef ET_LOGGER_ACTIVATE
- printf("WARNING: ");
- va_list arglist;
- va_start( arglist, format );
- vprintf( format, arglist );
- va_end( arglist );
- printf("\n");
-#endif
-}
-
-void etLogger_logInfoF(const char* format, ... ){
-#ifdef ET_LOGGER_ACTIVATE
- printf("INFO: ");
- va_list arglist;
- va_start( arglist, format );
- vprintf( format, arglist );
- va_end( arglist );
- printf("\n");
-#endif
-}
-
-etFileHandle etLogger_fopen(const char* filename, const char* mode){
-#ifdef ET_LOGGER_ACTIVATE
- return( fopen(filename, mode) );
-#endif
-}
-
-int etLogger_fclose(etFileHandle file){
-#ifdef ET_LOGGER_ACTIVATE
- return( fclose(file) );
-#endif
-}
-
-void etLogger_fprintf(etFileHandle file, const char* format, ... ){
-#ifdef ET_LOGGER_ACTIVATE
- va_list arglist;
- va_start( arglist, format );
- vfprintf(file, format, arglist );
- va_end( arglist );
-#endif
-}
+/*******************************************************************************
+ * 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)
+ *
+ *******************************************************************************/
+
+/*
+ * etLogger.c
+ *
+ * Created on: 16.01.2012
+ * Author: tschuetz
+ */
+
+//#define ET_LOGGER_ACTIVATE 1
+#include "debugging/etLogger.h"
+
+#include <stdarg.h>
+
+
+void etLogger_logError(const char* message){
+#ifdef ET_LOGGER_ACTIVATE
+ printf("ERROR: %s\n", message);
+#endif
+}
+
+void etLogger_logWarning(const char* message){
+#ifdef ET_LOGGER_ACTIVATE
+ printf("WARNING: %s\n", message);
+#endif
+}
+
+void etLogger_logInfo(const char* message){
+#ifdef ET_LOGGER_ACTIVATE
+ printf("INFO: %s\n", message);
+#endif
+}
+
+void etLogger_logErrorF(const char* format, ... ){
+#ifdef ET_LOGGER_ACTIVATE
+ printf("ERROR: ");
+ va_list arglist;
+ va_start( arglist, format );
+ vprintf( format, arglist );
+ va_end( arglist );
+ printf("\n");
+#endif
+}
+
+void etLogger_logWarningF(const char* format, ... ){
+#ifdef ET_LOGGER_ACTIVATE
+ printf("WARNING: ");
+ va_list arglist;
+ va_start( arglist, format );
+ vprintf( format, arglist );
+ va_end( arglist );
+ printf("\n");
+#endif
+}
+
+void etLogger_logInfoF(const char* format, ... ){
+#ifdef ET_LOGGER_ACTIVATE
+ printf("INFO: ");
+ va_list arglist;
+ va_start( arglist, format );
+ vprintf( format, arglist );
+ va_end( arglist );
+ printf("\n");
+#endif
+}
+
+etFileHandle etLogger_fopen(const char* filename, const char* mode){
+#ifdef ET_LOGGER_ACTIVATE
+ return( fopen(filename, mode) );
+#endif
+}
+
+int etLogger_fclose(etFileHandle file){
+#ifdef ET_LOGGER_ACTIVATE
+ return( fclose(file) );
+#endif
+}
+
+void etLogger_fprintf(etFileHandle file, const char* format, ... ){
+#ifdef ET_LOGGER_ACTIVATE
+ va_list arglist;
+ va_start( arglist, format );
+ vfprintf(file, format, arglist );
+ va_end( arglist );
+#endif
+}
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etPlatform.c b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etPlatform.c
index 5c81101ea..08798627a 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etPlatform.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etPlatform.c
@@ -1,52 +1,52 @@
-/*******************************************************************************
- * 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 "msp430g2553.h"
-#include "platform/etTimer.h"
-
-
-/* forward declarations */
-
-
-/* implemenatation for eTrice interfaces*/
-
-void etUserEntry(void){
- //Use WDT as interrupt timer
- WDTCTL = WDTPW + 0x16;
-
- DCOCTL = CALDCO_16MHZ;
- BCSCTL1 = CALBC1_16MHZ;
- BCSCTL2 = 0x00;
- BCSCTL3 = 0x0C;
-
- P1DIR = 0x01;
-
- IE1 |= 1;
-
- etTimer_init();
-
- _enable_interrupt();
-
-
-}
-
-void etUserPreRun(void){
- _enable_interrupt();
-}
-
-void etUserPostRun(void){ }
-void etUserExit(void){ }
-
-
-/* platform specific functions */
-
-
+/*******************************************************************************
+ * 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 "msp430g2553.h"
+#include "platform/etTimer.h"
+
+
+/* forward declarations */
+
+
+/* implemenatation for eTrice interfaces*/
+
+void etUserEntry(void){
+ //Use WDT as interrupt timer
+ WDTCTL = WDTPW + 0x16;
+
+ DCOCTL = CALDCO_16MHZ;
+ BCSCTL1 = CALBC1_16MHZ;
+ BCSCTL2 = 0x00;
+ BCSCTL3 = 0x0C;
+
+ P1DIR = 0x01;
+
+ IE1 |= 1;
+
+ etTimer_init();
+
+ _enable_interrupt();
+
+
+}
+
+void etUserPreRun(void){
+ _enable_interrupt();
+}
+
+void etUserPostRun(void){ }
+void etUserExit(void){ }
+
+
+/* platform specific functions */
+
+
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etTimer.c b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etTimer.c
index 22a691f61..d3fd107ab 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etTimer.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/etTimer.c
@@ -1,69 +1,69 @@
-#include "msp430g2553.h"
-#include "platform/etTimer.h"
-
-/* global timer */
-
-static etTargetTime_t targetTime;
-static etTargetTime_t lastTargetTime;
-static volatile etBool etTimer_executeFlag = FALSE;
-
-void etTimer_init(void){
- targetTime.nSec=0;
- targetTime.sec=0;
- lastTargetTime.nSec=0;
- lastTargetTime.sec=0;
-}
-
-etBool etTimer_executeNeeded(void){
- if (etTimer_executeFlag == TRUE){
- etTimer_executeFlag = FALSE;
- return TRUE;
- }
- else {
- return FALSE;
- }
-}
-
-uint32 getNSecFromTarget(void){
- etTargetTime_t time;
- getTimeFromTarget(&time);
- return time.nSec;
-}
-
-uint32 getSecFromTarget(void){
- etTargetTime_t time;
- getTimeFromTarget(&time);
- return time.sec;
-}
-
-
-void getTimeFromTarget(etTargetTime_t *t) {
- _disable_interrupt();
- *t = targetTime;
- _enable_interrupt();
-}
-
-/* the timer interrupt */
-#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;
- etTimer_executeFlag = TRUE;
-
- targetTime.nSec += 15625000L;
-
- if (targetTime.nSec >= 1000000000L) {
- targetTime.nSec -= 1000000000L;
- targetTime.sec++;
- }
- secCounter++;
-
- if (secCounter >= 64) {
- secCounter = 0;
-// P1OUT^=0x01;
- }
-
-} // end interrupt
+#include "msp430g2553.h"
+#include "platform/etTimer.h"
+
+/* global timer */
+
+static etTargetTime_t targetTime;
+static etTargetTime_t lastTargetTime;
+static volatile etBool etTimer_executeFlag = FALSE;
+
+void etTimer_init(void){
+ targetTime.nSec=0;
+ targetTime.sec=0;
+ lastTargetTime.nSec=0;
+ lastTargetTime.sec=0;
+}
+
+etBool etTimer_executeNeeded(void){
+ if (etTimer_executeFlag == TRUE){
+ etTimer_executeFlag = FALSE;
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
+}
+
+uint32 getNSecFromTarget(void){
+ etTargetTime_t time;
+ getTimeFromTarget(&time);
+ return time.nSec;
+}
+
+uint32 getSecFromTarget(void){
+ etTargetTime_t time;
+ getTimeFromTarget(&time);
+ return time.sec;
+}
+
+
+void getTimeFromTarget(etTargetTime_t *t) {
+ _disable_interrupt();
+ *t = targetTime;
+ _enable_interrupt();
+}
+
+/* the timer interrupt */
+#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;
+ etTimer_executeFlag = TRUE;
+
+ targetTime.nSec += 15625000L;
+
+ if (targetTime.nSec >= 1000000000L) {
+ targetTime.nSec -= 1000000000L;
+ targetTime.sec++;
+ }
+ secCounter++;
+
+ if (secCounter >= 64) {
+ secCounter = 0;
+// P1OUT^=0x01;
+ }
+
+} // end interrupt
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/info.txt b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/info.txt
index 71c5f9f3f..b8f84e38c 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/info.txt
+++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_MSP430_G2553_CCS5_LaunchPad/info.txt
@@ -1 +1 @@
-TI-MSP430
+TI-MSP430

Back to the top