Changed the device name.

Dependents:   BLE_Health_Thermometer_HeartRateMonitor

Fork of BLE_API_Native_IRC by Yoshihiro TSUBOI

Committer:
ghz2000
Date:
Mon Jun 16 15:06:48 2014 +0000
Revision:
20:a58a51c92075
Parent:
0:4c3097c65247
Add HeartRateMonitor

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ktownsend 0:4c3097c65247 1 /**************************************************************************/
ktownsend 0:4c3097c65247 2 /*!
ktownsend 0:4c3097c65247 3 @file compiler.h
ktownsend 0:4c3097c65247 4 @author hathach (tinyusb.org)
ktownsend 0:4c3097c65247 5
ktownsend 0:4c3097c65247 6 @section LICENSE
ktownsend 0:4c3097c65247 7
ktownsend 0:4c3097c65247 8 Software License Agreement (BSD License)
ktownsend 0:4c3097c65247 9
ktownsend 0:4c3097c65247 10 Copyright (c) 2013, K. Townsend (microBuilder.eu)
ktownsend 0:4c3097c65247 11 All rights reserved.
ktownsend 0:4c3097c65247 12
ktownsend 0:4c3097c65247 13 Redistribution and use in source and binary forms, with or without
ktownsend 0:4c3097c65247 14 modification, are permitted provided that the following conditions are met:
ktownsend 0:4c3097c65247 15 1. Redistributions of source code must retain the above copyright
ktownsend 0:4c3097c65247 16 notice, this list of conditions and the following disclaimer.
ktownsend 0:4c3097c65247 17 2. Redistributions in binary form must reproduce the above copyright
ktownsend 0:4c3097c65247 18 notice, this list of conditions and the following disclaimer in the
ktownsend 0:4c3097c65247 19 documentation and/or other materials provided with the distribution.
ktownsend 0:4c3097c65247 20 3. Neither the name of the copyright holders nor the
ktownsend 0:4c3097c65247 21 names of its contributors may be used to endorse or promote products
ktownsend 0:4c3097c65247 22 derived from this software without specific prior written permission.
ktownsend 0:4c3097c65247 23
ktownsend 0:4c3097c65247 24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
ktownsend 0:4c3097c65247 25 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
ktownsend 0:4c3097c65247 26 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
ktownsend 0:4c3097c65247 27 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
ktownsend 0:4c3097c65247 28 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
ktownsend 0:4c3097c65247 29 INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
ktownsend 0:4c3097c65247 30 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND
ktownsend 0:4c3097c65247 31 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
ktownsend 0:4c3097c65247 32 INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
ktownsend 0:4c3097c65247 33 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ktownsend 0:4c3097c65247 34 */
ktownsend 0:4c3097c65247 35 /**************************************************************************/
ktownsend 0:4c3097c65247 36
ktownsend 0:4c3097c65247 37 /** \file
ktownsend 0:4c3097c65247 38 * \brief GCC Header
ktownsend 0:4c3097c65247 39 */
ktownsend 0:4c3097c65247 40
ktownsend 0:4c3097c65247 41 /** \ingroup Group_Compiler
ktownsend 0:4c3097c65247 42 * \defgroup Group_GCC GNU GCC
ktownsend 0:4c3097c65247 43 * @{
ktownsend 0:4c3097c65247 44 */
ktownsend 0:4c3097c65247 45
ktownsend 0:4c3097c65247 46 #ifndef _COMPILER_GCC_H_
ktownsend 0:4c3097c65247 47 #define _COMPILER_GCC_H_
ktownsend 0:4c3097c65247 48
ktownsend 0:4c3097c65247 49 #ifdef __cplusplus
ktownsend 0:4c3097c65247 50 extern "C" {
ktownsend 0:4c3097c65247 51 #endif
ktownsend 0:4c3097c65247 52
ktownsend 0:4c3097c65247 53 #include "projectconfig.h"
ktownsend 0:4c3097c65247 54
ktownsend 0:4c3097c65247 55 //#ifndef __GNUC__
ktownsend 0:4c3097c65247 56 // #define ATTR_ALWAYS_INLINE
ktownsend 0:4c3097c65247 57 // #define ATTR_CONST
ktownsend 0:4c3097c65247 58 //#else
ktownsend 0:4c3097c65247 59
ktownsend 0:4c3097c65247 60 #ifdef _TEST_
ktownsend 0:4c3097c65247 61 #define ATTR_ALWAYS_INLINE
ktownsend 0:4c3097c65247 62 #define STATIC_
ktownsend 0:4c3097c65247 63 #define INLINE_
ktownsend 0:4c3097c65247 64 #else
ktownsend 0:4c3097c65247 65 #define STATIC_ static
ktownsend 0:4c3097c65247 66 #define INLINE_ inline
ktownsend 0:4c3097c65247 67
ktownsend 0:4c3097c65247 68 #if CFG_DEBUG == 3
ktownsend 0:4c3097c65247 69 #define ATTR_ALWAYS_INLINE // no inline for debug = 3
ktownsend 0:4c3097c65247 70 #endif
ktownsend 0:4c3097c65247 71 #endif
ktownsend 0:4c3097c65247 72
ktownsend 0:4c3097c65247 73 #define ALIGN_OF(x) __alignof__(x)
ktownsend 0:4c3097c65247 74
ktownsend 0:4c3097c65247 75 /// Normally, the compiler places the objects it generates in sections like data or bss & function in text. Sometimes, however, you need additional sections, or you need certain particular variables to appear in special sections, for example to map to special hardware. The section attribute specifies that a variable (or function) lives in a particular section
ktownsend 0:4c3097c65247 76 #define ATTR_SECTION(section) __attribute__ ((#section))
ktownsend 0:4c3097c65247 77
ktownsend 0:4c3097c65247 78 /// If this attribute is used on a function declaration and a call to such a function is not eliminated through dead code elimination or other optimizations, an error that includes message is diagnosed. This is useful for compile-time checking
ktownsend 0:4c3097c65247 79 #define ATTR_ERROR(Message) __attribute__ ((error(Message)))
ktownsend 0:4c3097c65247 80
ktownsend 0:4c3097c65247 81 /// If this attribute is used on a function declaration and a call to such a function is not eliminated through dead code elimination or other optimizations, a warning that includes message is diagnosed. This is useful for compile-time checking
ktownsend 0:4c3097c65247 82 #define ATTR_WARNING(Message) __attribute__ ((warning(Message)))
ktownsend 0:4c3097c65247 83
ktownsend 0:4c3097c65247 84 /**
ktownsend 0:4c3097c65247 85 * \defgroup Group_VariableAttr Variable Attributes
ktownsend 0:4c3097c65247 86 * @{
ktownsend 0:4c3097c65247 87 */
ktownsend 0:4c3097c65247 88
ktownsend 0:4c3097c65247 89 /// This attribute specifies a minimum alignment for the variable or structure field, measured in bytes
ktownsend 0:4c3097c65247 90 #define ATTR_ALIGNED(Bytes) __attribute__ ((aligned(Bytes)))
ktownsend 0:4c3097c65247 91
ktownsend 0:4c3097c65247 92 /// The packed attribute specifies that a variable or structure field should have the smallest possible alignment—one byte for a variable, and one bit for a field, unless you specify a larger value with the aligned attribute
ktownsend 0:4c3097c65247 93 #define ATTR_PACKED __attribute__ ((packed))
ktownsend 0:4c3097c65247 94
ktownsend 0:4c3097c65247 95 #define ATTR_PREPACKED
ktownsend 0:4c3097c65247 96
ktownsend 0:4c3097c65247 97 #define ATTR_PACKED_STRUCT(x) x __attribute__ ((packed))
ktownsend 0:4c3097c65247 98 /** @} */
ktownsend 0:4c3097c65247 99
ktownsend 0:4c3097c65247 100 /**
ktownsend 0:4c3097c65247 101 * \defgroup Group_FuncAttr Function Attributes
ktownsend 0:4c3097c65247 102 * @{
ktownsend 0:4c3097c65247 103 */
ktownsend 0:4c3097c65247 104
ktownsend 0:4c3097c65247 105 #ifndef ATTR_ALWAYS_INLINE
ktownsend 0:4c3097c65247 106 /// Generally, functions are not inlined unless optimization is specified. For functions declared inline, this attribute inlines the function even if no optimization level is specified
ktownsend 0:4c3097c65247 107 #define ATTR_ALWAYS_INLINE __attribute__ ((always_inline))
ktownsend 0:4c3097c65247 108 #endif
ktownsend 0:4c3097c65247 109
ktownsend 0:4c3097c65247 110 /// The nonnull attribute specifies that some function parameters should be non-null pointers. f the compiler determines that a null pointer is passed in an argument slot marked as non-null, and the -Wnonnull option is enabled, a warning is issued. All pointer arguments are marked as non-null
ktownsend 0:4c3097c65247 111 #define ATTR_NON_NULL __attribute__ ((nonull))
ktownsend 0:4c3097c65247 112
ktownsend 0:4c3097c65247 113 /// Many functions have no effects except the return value and their return value depends only on the parameters and/or global variables. Such a function can be subject to common subexpression elimination and loop optimization just as an arithmetic operator would be. These functions should be declared with the attribute pure
ktownsend 0:4c3097c65247 114 #define ATTR_PURE __attribute__ ((pure))
ktownsend 0:4c3097c65247 115
ktownsend 0:4c3097c65247 116 /// Many functions do not examine any values except their arguments, and have no effects except the return value. Basically this is just slightly more strict class than the pure attribute below, since function is not allowed to read global memory.
ktownsend 0:4c3097c65247 117 /// Note that a function that has pointer arguments and examines the data pointed to must not be declared const. Likewise, a function that calls a non-const function usually must not be const. It does not make sense for a const function to return void
ktownsend 0:4c3097c65247 118 #define ATTR_CONST __attribute__ ((const))
ktownsend 0:4c3097c65247 119
ktownsend 0:4c3097c65247 120 /// The deprecated attribute results in a warning if the function is used anywhere in the source file. This is useful when identifying functions that are expected to be removed in a future version of a program. The warning also includes the location of the declaration of the deprecated function, to enable users to easily find further information about why the function is deprecated, or what they should do instead. Note that the warnings only occurs for uses
ktownsend 0:4c3097c65247 121 #define ATTR_DEPRECATED __attribute__ ((deprecated))
ktownsend 0:4c3097c65247 122
ktownsend 0:4c3097c65247 123 /// Same as the deprecated attribute with optional message in the warning
ktownsend 0:4c3097c65247 124 #define ATTR_DEPRECATED_MESS(mess) __attribute__ ((deprecated(mess)))
ktownsend 0:4c3097c65247 125
ktownsend 0:4c3097c65247 126 /// The weak attribute causes the declaration to be emitted as a weak symbol rather than a global. This is primarily useful in defining library functions that can be overridden in user code
ktownsend 0:4c3097c65247 127 #define ATTR_WEAK __attribute__ ((weak))
ktownsend 0:4c3097c65247 128
ktownsend 0:4c3097c65247 129 /// The alias attribute causes the declaration to be emitted as an alias for another symbol, which must be specified
ktownsend 0:4c3097c65247 130 #define ATTR_ALIAS(func) __attribute__ ((alias(#func)))
ktownsend 0:4c3097c65247 131
ktownsend 0:4c3097c65247 132 /// The weakref attribute marks a declaration as a weak reference. It is equivalent with weak + alias attribute, but require function is static
ktownsend 0:4c3097c65247 133 #define ATTR_WEAKREF(func) __attribute__ ((weakref(#func)))
ktownsend 0:4c3097c65247 134
ktownsend 0:4c3097c65247 135 /// The warn_unused_result attribute causes a warning to be emitted if a caller of the function with this attribute does not use its return value. This is useful for functions where not checking the result is either a security problem or always a bug
ktownsend 0:4c3097c65247 136 #define ATTR_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))
ktownsend 0:4c3097c65247 137
ktownsend 0:4c3097c65247 138 /// This attribute, attached to a function, means that code must be emitted for the function even if it appears that the function is not referenced. This is useful, for example, when the function is referenced only in inline assembly.
ktownsend 0:4c3097c65247 139 #define ATTR_USED __attribute__ ((used))
ktownsend 0:4c3097c65247 140
ktownsend 0:4c3097c65247 141 /// This attribute, attached to a function, means that the function is meant to be possibly unused. GCC does not produce a warning for this function.
ktownsend 0:4c3097c65247 142 #define ATTR_UNUSED __attribute__ ((unused))
ktownsend 0:4c3097c65247 143
ktownsend 0:4c3097c65247 144 /** @} */
ktownsend 0:4c3097c65247 145
ktownsend 0:4c3097c65247 146 #ifdef __cplusplus
ktownsend 0:4c3097c65247 147 }
ktownsend 0:4c3097c65247 148 #endif
ktownsend 0:4c3097c65247 149
ktownsend 0:4c3097c65247 150 #endif /* _COMPILER_GCC_H_ */
ktownsend 0:4c3097c65247 151
ktownsend 0:4c3097c65247 152 /// @}