From 9c56bcc138b4646e0e6777a3b53afe8e40c9823b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 26 Feb 2013 14:50:16 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5333 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/ch.h | 4 ++-- os/ports/GCC/ARM/chtypes.h | 9 ++------- os/ports/GCC/ARMCMx/chtypes.h | 7 ++----- os/ports/GCC/AVR/chtypes.h | 9 ++------- os/ports/GCC/MSP430/chtypes.h | 9 ++------- os/ports/GCC/PPC/chtypes.h | 8 ++------ os/ports/GCC/SIMIA32/chtypes.h | 9 ++------- os/ports/IAR/ARMCMx/chtypes.h | 7 ++----- os/ports/IAR/STM8/chtypes.h | 8 ++------ os/ports/RC/STM8/chtypes.h | 17 ++++++++++------- os/ports/RVCT/ARMCMx/chtypes.h | 7 ++----- os/ports/cosmic/STM8/chtypes.h | 17 ++++++++++------- 12 files changed, 40 insertions(+), 71 deletions(-) diff --git a/os/kernel/include/ch.h b/os/kernel/include/ch.h index f123cd4a0..4cb973065 100644 --- a/os/kernel/include/ch.h +++ b/os/kernel/include/ch.h @@ -69,14 +69,14 @@ * @brief Generic 'false' boolean constant. */ #if !defined(FALSE) || defined(__DOXYGEN__) -#define FALSE 0 +#define FALSE false #endif /** * @brief Generic 'true' boolean constant. */ #if !defined(TRUE) || defined(__DOXYGEN__) -#define TRUE (!FALSE) +#define TRUE true #endif /** diff --git a/os/ports/GCC/ARM/chtypes.h b/os/ports/GCC/ARM/chtypes.h index c87992bb9..36bebf14f 100644 --- a/os/ports/GCC/ARM/chtypes.h +++ b/os/ports/GCC/ARM/chtypes.h @@ -29,16 +29,11 @@ #ifndef _CHTYPES_H_ #define _CHTYPES_H_ -#define __need_NULL -#define __need_size_t -#define __need_ptrdiff_t #include - -#if !defined(_STDINT_H) && !defined(__STDINT_H_) #include -#endif +#include -typedef int32_t bool_t; /**< Fast boolean type. */ +typedef bool bool_t; /**< Fast boolean type. */ typedef uint8_t tmode_t; /**< Thread flags. */ typedef uint8_t tstate_t; /**< Thread state. */ typedef uint8_t trefs_t; /**< Thread references counter. */ diff --git a/os/ports/GCC/ARMCMx/chtypes.h b/os/ports/GCC/ARMCMx/chtypes.h index 035e135b5..a94ae24ae 100644 --- a/os/ports/GCC/ARMCMx/chtypes.h +++ b/os/ports/GCC/ARMCMx/chtypes.h @@ -29,14 +29,11 @@ #ifndef _CHTYPES_H_ #define _CHTYPES_H_ -#define __need_NULL -#define __need_size_t -#define __need_ptrdiff_t #include - #include +#include -typedef int32_t bool_t; /**< Fast boolean type. */ +typedef bool bool_t; /**< Fast boolean type. */ typedef uint8_t tmode_t; /**< Thread flags. */ typedef uint8_t tstate_t; /**< Thread state. */ typedef uint8_t trefs_t; /**< Thread references counter. */ diff --git a/os/ports/GCC/AVR/chtypes.h b/os/ports/GCC/AVR/chtypes.h index 5e257b0d0..59d896af4 100644 --- a/os/ports/GCC/AVR/chtypes.h +++ b/os/ports/GCC/AVR/chtypes.h @@ -29,16 +29,11 @@ #ifndef _CHTYPES_H_ #define _CHTYPES_H_ -#define __need_NULL -#define __need_size_t -#define __need_ptrdiff_t #include - -#if !defined(_STDINT_H) && !defined(__STDINT_H_) #include -#endif +#include -typedef int8_t bool_t; /**< Fast boolean type. */ +typedef bool bool_t; /**< Fast boolean type. */ typedef uint8_t tmode_t; /**< Thread flags. */ typedef uint8_t tstate_t; /**< Thread state. */ typedef uint8_t trefs_t; /**< Thread references counter. */ diff --git a/os/ports/GCC/MSP430/chtypes.h b/os/ports/GCC/MSP430/chtypes.h index 2480eb118..84ced2aaf 100644 --- a/os/ports/GCC/MSP430/chtypes.h +++ b/os/ports/GCC/MSP430/chtypes.h @@ -29,16 +29,11 @@ #ifndef _CHTYPES_H_ #define _CHTYPES_H_ -#define __need_NULL -#define __need_size_t -#define __need_ptrdiff_t #include - -#if !defined(_STDINT_H) && !defined(__STDINT_H_) #include -#endif +#include -typedef int16_t bool_t; /**< Fast boolean type. */ +typedef bool bool_t; /**< Fast boolean type. */ typedef uint8_t tmode_t; /**< Thread flags. */ typedef uint8_t tstate_t; /**< Thread state. */ typedef uint8_t trefs_t; /**< Thread references counter. */ diff --git a/os/ports/GCC/PPC/chtypes.h b/os/ports/GCC/PPC/chtypes.h index 6d22b7353..37f4419f6 100644 --- a/os/ports/GCC/PPC/chtypes.h +++ b/os/ports/GCC/PPC/chtypes.h @@ -29,13 +29,9 @@ #ifndef _CHTYPES_H_ #define _CHTYPES_H_ -#define __need_NULL -#define __need_size_t #include - -#if !defined(_STDINT_H) && !defined(__STDINT_H_) #include -#endif +#include /* * Derived generic types. @@ -50,7 +46,7 @@ typedef volatile uint32_t vuint32_t; /**< Volatile unsigned 32 bits. */ /* * Kernel types. */ -typedef int32_t bool_t; /**< Fast boolean type. */ +typedef bool bool_t; /**< Fast boolean type. */ typedef uint8_t tmode_t; /**< Thread flags. */ typedef uint8_t tstate_t; /**< Thread state. */ typedef uint8_t trefs_t; /**< Thread references counter. */ diff --git a/os/ports/GCC/SIMIA32/chtypes.h b/os/ports/GCC/SIMIA32/chtypes.h index 72cc1661b..b10eed325 100644 --- a/os/ports/GCC/SIMIA32/chtypes.h +++ b/os/ports/GCC/SIMIA32/chtypes.h @@ -21,16 +21,11 @@ #ifndef _CHTYPES_H_ #define _CHTYPES_H_ -#define __need_NULL -#define __need_size_t -#define __need_ptrdiff_t #include - -#if !defined(_STDINT_H) && !defined(__STDINT_H_) #include -#endif +#include -typedef int32_t bool_t; /**< Fast boolean type. */ +typedef bool bool_t; /**< Fast boolean type. */ typedef uint8_t tmode_t; /**< Thread flags. */ typedef uint8_t tstate_t; /**< Thread state. */ typedef uint8_t trefs_t; /**< Thread references counter. */ diff --git a/os/ports/IAR/ARMCMx/chtypes.h b/os/ports/IAR/ARMCMx/chtypes.h index b21fbc7b6..9855c4e00 100644 --- a/os/ports/IAR/ARMCMx/chtypes.h +++ b/os/ports/IAR/ARMCMx/chtypes.h @@ -29,14 +29,11 @@ #ifndef _CHTYPES_H_ #define _CHTYPES_H_ -#define __need_NULL -#define __need_size_t -#define __need_ptrdiff_t #include - #include +#include -typedef int32_t bool_t; /**< Fast boolean type. */ +typedef bool bool_t; /**< Fast boolean type. */ typedef uint8_t tmode_t; /**< Thread flags. */ typedef uint8_t tstate_t; /**< Thread state. */ typedef uint8_t trefs_t; /**< Thread references counter. */ diff --git a/os/ports/IAR/STM8/chtypes.h b/os/ports/IAR/STM8/chtypes.h index a2ad1f4a1..f418256e1 100644 --- a/os/ports/IAR/STM8/chtypes.h +++ b/os/ports/IAR/STM8/chtypes.h @@ -29,15 +29,11 @@ #ifndef _CHTYPES_H_ #define _CHTYPES_H_ -#define __need_NULL -#define __need_size_t #include - -#if !defined(_STDINT_H) && !defined(__STDINT_H_) #include -#endif +#include -typedef int8_t bool_t; /**< Fast boolean type. */ +typedef bool bool_t; /**< Fast boolean type. */ typedef uint8_t tmode_t; /**< Thread flags. */ typedef uint8_t tstate_t; /**< Thread state. */ typedef uint8_t trefs_t; /**< Thread references counter. */ diff --git a/os/ports/RC/STM8/chtypes.h b/os/ports/RC/STM8/chtypes.h index cbe47e821..ffc972f14 100644 --- a/os/ports/RC/STM8/chtypes.h +++ b/os/ports/RC/STM8/chtypes.h @@ -29,14 +29,9 @@ #ifndef _CHTYPES_H_ #define _CHTYPES_H_ -#define __need_NULL -#define __need_size_t #include -//#if !defined(_STDINT_H) && !defined(__STDINT_H_) -//#include -//#endif - +typedef unsigned char uint8t; /**< C99-style boolean. */ typedef unsigned char uint8_t; /**< C99-style 8 bits unsigned. */ typedef signed char int8_t; /**< C99-style 8 bits signed. */ typedef unsigned int uint16_t; /**< C99-style 16 bits unsigned. */ @@ -47,7 +42,15 @@ typedef uint8_t uint_fast8_t; /**< C99-style 8 bits unsigned. */ typedef uint16_t uint_fast16_t; /**< C99-style 16 bits unsigned. */ typedef uint32_t uint_fast32_t; /**< C99-style 32 bits unsigned. */ -typedef int8_t bool_t; /**< Fast boolean type. */ +#if !defined(false) || defined(__DOXYGEN__) +#define false 0 +#endif + +#if !defined(true) || defined(__DOXYGEN__) +#define true (!false) +#endif + +typedef bool bool_t; /**< Fast boolean type. */ typedef uint8_t tmode_t; /**< Thread flags. */ typedef uint8_t tstate_t; /**< Thread state. */ typedef uint8_t trefs_t; /**< Thread references counter. */ diff --git a/os/ports/RVCT/ARMCMx/chtypes.h b/os/ports/RVCT/ARMCMx/chtypes.h index 8dbda9d82..b3f19f674 100644 --- a/os/ports/RVCT/ARMCMx/chtypes.h +++ b/os/ports/RVCT/ARMCMx/chtypes.h @@ -29,14 +29,11 @@ #ifndef _CHTYPES_H_ #define _CHTYPES_H_ -#define __need_NULL -#define __need_size_t -#define __need_ptrdiff_t #include - #include +#include -typedef int32_t bool_t; /**< Fast boolean type. */ +typedef bool bool_t; /**< Fast boolean type. */ typedef uint8_t tmode_t; /**< Thread flags. */ typedef uint8_t tstate_t; /**< Thread state. */ typedef uint8_t trefs_t; /**< Thread references counter. */ diff --git a/os/ports/cosmic/STM8/chtypes.h b/os/ports/cosmic/STM8/chtypes.h index 87c70e270..efd25964e 100644 --- a/os/ports/cosmic/STM8/chtypes.h +++ b/os/ports/cosmic/STM8/chtypes.h @@ -29,14 +29,9 @@ #ifndef _CHTYPES_H_ #define _CHTYPES_H_ -#define __need_NULL -#define __need_size_t #include -//#if !defined(_STDINT_H) && !defined(__STDINT_H_) -//#include -//#endif - +typedef unsigned char uint8t; /**< C99-style boolean. */ typedef unsigned char uint8_t; /**< C99-style 8 bits unsigned. */ typedef signed char int8_t; /**< C99-style 8 bits signed. */ typedef unsigned int uint16_t; /**< C99-style 16 bits unsigned. */ @@ -47,7 +42,15 @@ typedef uint8_t uint_fast8_t; /**< C99-style 8 bits unsigned. */ typedef uint16_t uint_fast16_t; /**< C99-style 16 bits unsigned. */ typedef uint32_t uint_fast32_t; /**< C99-style 32 bits unsigned. */ -typedef int8_t bool_t; /**< Fast boolean type. */ +#if !defined(false) || defined(__DOXYGEN__) +#define false 0 +#endif + +#if !defined(true) || defined(__DOXYGEN__) +#define true (!false) +#endif + +typedef bool bool_t; /**< Fast boolean type. */ typedef uint8_t tmode_t; /**< Thread flags. */ typedef uint8_t tstate_t; /**< Thread state. */ typedef uint8_t trefs_t; /**< Thread references counter. */