diff options
author | Juergen Haug | 2015-07-21 15:33:52 +0000 |
---|---|---|
committer | Juergen Haug | 2015-07-31 10:02:07 +0000 |
commit | 33c71f0684c7483aa25428d765ebfb089a954a67 (patch) | |
tree | 103aa43a654afbe3fee105de51dff0ca19067c38 /runtime/org.eclipse.etrice.runtime.c/src/platforms | |
parent | a988c716e9c73a44fc1db44a0ec1d779a60c2599 (diff) | |
download | org.eclipse.etrice-33c71f0684c7483aa25428d765ebfb089a954a67.tar.gz org.eclipse.etrice-33c71f0684c7483aa25428d765ebfb089a954a67.tar.xz org.eclipse.etrice-33c71f0684c7483aa25428d765ebfb089a954a67.zip |
Bug 472908 - refactor etDatatypes.h
Change-Id: Iccd39b112f4e340e7276d65820decb672a1091fb
Diffstat (limited to 'runtime/org.eclipse.etrice.runtime.c/src/platforms')
4 files changed, 63 insertions, 257 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_32Bit_FreeRTOS_Generic/etDatatypes.h b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_32Bit_FreeRTOS_Generic/etDatatypes.h index e0b270816..40d3aaaef 100644 --- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_32Bit_FreeRTOS_Generic/etDatatypes.h +++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_32Bit_FreeRTOS_Generic/etDatatypes.h @@ -14,9 +14,15 @@ #define _ETDATATYPES_H_ /* - * typedefs for FreeRTOS on a 32Bit environment - * - * */ + * typedefs for platform specific datatypes + * FreeRTOS on a 32Bit version + */ + +#define ET_INT64 +#define ET_FLOAT32 +//#define ET_FLOAT64 /* not available on this platform */ + +#include "etStdDatatypes.h" #include <stdio.h> #include <FreeRTOS.h> @@ -24,75 +30,26 @@ #include <timers.h> #include <semphr.h> -/* unsigned integer datatypes */ -typedef unsigned char uint8; -typedef unsigned short int uint16; -typedef unsigned int uint32; -typedef unsigned long long uint64; - -/* signed integer datatypes */ -typedef char int8; -typedef short int int16; -typedef int int32; -typedef long long int64; - +/*--- Data types for room.basic.types */ -/* 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; -typedef char boolean; - -#ifndef ET_TRUE - #define ET_TRUE 1 -#endif -#ifndef ET_FALSE - #define ET_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 char etBool; +/*--- Data types for runtime */ #define ALIGNMENT 4 /* power of 2 and >= sizeof(int) ! */ -typedef float32 etFloat32; -typedef float32 etFloat64; - -/* string datatypes */ -typedef char* charPtr; - - typedef FILE* etFileHandle; -typedef int8 etAddressId; - - -/* - * typedefs for OS-specific types - */ +/* types for osal */ typedef xSemaphoreHandle etOSMutexData; typedef xSemaphoreHandle etOSSemaData; typedef xTaskHandle etOSThreadData; -typedef uint16 etOSThreadId; +typedef etUInt16 etOSThreadId; typedef xTimerHandle etOSTimerData; -typedef uint16 etOSTimerId; +typedef etUInt16 etOSTimerId; + +/*-----------------------------------------------------------*/ #endif /* _DATATYPES_H_ */ diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_POSIX_GENERIC_GCC/etDatatypes.h b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_POSIX_GENERIC_GCC/etDatatypes.h index 007aa865c..14407a0a1 100644 --- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_POSIX_GENERIC_GCC/etDatatypes.h +++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_POSIX_GENERIC_GCC/etDatatypes.h @@ -17,8 +17,13 @@ /* * typedefs for platform specific datatypes * POSIX version - * - * */ + */ + +#define ET_INT64 +#define ET_FLOAT32 +#define ET_FLOAT64 + +#include "etStdDatatypes.h" #include <stdio.h> #include <pthread.h> @@ -26,79 +31,17 @@ #include <signal.h> #include <sys/types.h> -/* unsigned integer datatypes */ -typedef unsigned char uint8; -typedef unsigned short int uint16; -typedef unsigned long uint32; -typedef unsigned long long uint64; - -/* signed integer datatypes */ -typedef char int8; -typedef short int int16; -typedef long int32; -typedef long long int64; - +/*--- Data types for room.basic.types */ -/* float datatypes */ -typedef float float32; -typedef double float64; +/*-----------------------------------------------------------*/ -/* string datatypes */ -typedef char* charPtr; - - -#ifndef NULL - #define NULL 0 -#endif - -/* boolean datatypes and values */ -typedef char bool; /* TODO: bool, Bool, Boolean, and boolean are already defined in some platforms*/ -typedef bool boolean; - -#ifndef ET_TRUE - #define ET_TRUE 1 -#endif -#ifndef ET_FALSE - #define ET_FALSE 0 -#endif -#ifndef true - #define true 1 -#endif -#ifndef false - #define false 0 -#endif - -#define ALIGNMENT 8 /* power of 2 and >= sizeof(int) ! */ - -/* - * 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 charPtr etCharPtr; - -typedef float32 etFloat32; -typedef float64 etFloat64; - -typedef bool etBool; +/*--- Data types for runtime */ +#define etALIGNMENT 8 /* power of 2 and >= sizeof(int) ! */ typedef FILE* etFileHandle; -typedef int16 etAddressId; - -/* - * typedefs for OS-specific types - */ - +/* types for osal */ typedef pthread_mutex_t etOSMutexData; typedef pthread_t etOSThreadData; typedef pthread_t etOSThreadId; @@ -108,9 +51,9 @@ typedef struct { timer_t timerid; sigevent_t te; etBool signaled; -} -etOSTimerData; +} etOSTimerData; typedef timer_t etOSTimerId; +/*-----------------------------------------------------------*/ #endif /* _DATATYPES_H_ */ diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etDatatypes.h b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etDatatypes.h index a50da01b2..8adfcda08 100644 --- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etDatatypes.h +++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW/etDatatypes.h @@ -15,87 +15,31 @@ /* * typedefs for platform specific datatypes - * generic Version for most bigger 32 and 64 bit platforms like Linux an Windows - * - * */ + * MinGW version + */ + +#define ET_INT64 +#define ET_FLOAT32 +#define ET_FLOAT64 + +#include "etStdDatatypes.h" #include <stdio.h> #define WINVER 0x0500 #include <windows.h> -/* unsigned integer datatypes */ -typedef unsigned char uint8; -typedef unsigned short int uint16; -typedef unsigned long uint32; -typedef unsigned long long uint64; - -/* signed integer datatypes */ -typedef char int8; -typedef short int int16; -typedef long int32; -typedef long long int64; - - -/* float datatypes */ -typedef float float32; -typedef double float64; - -/* string datatypes */ -typedef char* charPtr; - - -#ifndef NULL - #define NULL 0 -#endif - -/* boolean datatypes and values */ -typedef char bool; /* TODO: bool, Bool, Boolean, and boolean are already defined in some platforms*/ - -#ifndef ET_TRUE - #define ET_TRUE 1 -#endif -#ifndef ET_FALSE - #define ET_FALSE 0 -#endif -#ifndef true - #define true 1 -#endif -#ifndef false - #define false 0 -#endif +/*--- Data types for room.basic.types */ -#define ALIGNMENT 8 /* power of 2 and >= sizeof(int) ! */ +/*-----------------------------------------------------------*/ -/* - * 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 charPtr etCharPtr; - -typedef float32 etFloat32; -typedef float64 etFloat64; - -typedef bool etBool; +/*--- Data types for runtime */ +#define etALIGNMENT 8 /* power of 2 and >= sizeof(int) ! */ typedef FILE* etFileHandle; -typedef int16 etAddressId; - -/* - * typedefs for OS-specific types - */ - +/* types for osal */ typedef CRITICAL_SECTION etOSMutexData; typedef HANDLE etOSThreadData; typedef DWORD etOSThreadId; @@ -103,4 +47,6 @@ typedef HANDLE etOSSemaData; typedef HANDLE etOSTimerData; typedef DWORD etOSTimerId; +/*-----------------------------------------------------------*/ + #endif /* _DATATYPES_H_ */ diff --git a/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_32Bit_Generic/etDatatypes.h b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_32Bit_Generic/etDatatypes.h index 762d9b50c..f21fb05d4 100644 --- a/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_32Bit_Generic/etDatatypes.h +++ b/runtime/org.eclipse.etrice.runtime.c/src/platforms/ST_32Bit_Generic/etDatatypes.h @@ -16,75 +16,35 @@ /* * typedefs for platform specific datatypes * Version for 32 Bit Controllers like ARM Cortex M - * - * */ - -#include <stdio.h> - -/* unsigned integer datatypes */ -typedef unsigned char uint8; -typedef unsigned short int uint16; -typedef unsigned int uint32; -typedef unsigned long long uint64; - -/* signed integer datatypes */ -typedef char int8; -typedef short int int16; -typedef int int32; -typedef long long int64; + */ +#define ET_INT64 +#define ET_FLOAT32 +//#define ET_FLOAT64 /* not available on this platform */ -/* float datatypes */ -typedef float float32; -/* typedef double float64; */ /* not available on this platform */ -/* boolean datatypes and values */ -typedef char boolean; -#ifndef ET_TRUE - #define ET_TRUE 1 -#endif -#ifndef ET_FALSE - #define ET_FALSE 0 -#endif +#include "etStdDatatypes.h" -/* - * typedefs for eTrice Runtime and Testing - * - * */ +#include <stdio.h> -typedef int8 etInt8; -typedef int16 etInt16; -typedef int32 etInt32; +/*--- Data types for room.basic.types */ -typedef uint8 etUInt8; -typedef uint16 etUInt16; -typedef uint32 etUInt32; +/*-----------------------------------------------------------*/ -//typedef bool etBool; -typedef char etBool; +/*--- Data types for runtime */ #define ALIGNMENT 4 /* power of 2 and >= sizeof(int) ! */ -typedef float32 etFloat32; -typedef float32 etFloat64; - -/* string datatypes */ -typedef char* charPtr; - - typedef FILE* etFileHandle; -typedef int8 etAddressId; +/* types for osal */ +typedef etUInt32 etOSMutexData; +typedef etUInt32 etOSSemaData; +typedef etUInt32 etOSThreadData; +typedef etUInt32 etOSThreadId; +typedef etUInt32 etOSTimerData; +typedef etUInt32 etOSTimerId; - -/* - * typedefs for OS-specific types - */ -typedef uint32 etOSMutexData; -typedef uint32 etOSSemaData; -typedef uint32 etOSThreadData; -typedef uint32 etOSThreadId; -typedef uint32 etOSTimerData; -typedef uint32 etOSTimerId; +/*-----------------------------------------------------------*/ #endif /* _DATATYPES_H_ */ |