shunpei kataoka / nRF51822

Fork of nRF51822 by Shuta Nakamae

Committer:
rgrover1
Date:
Wed Dec 02 10:32:51 2015 +0000
Revision:
496:08bd8a46630b
Child:
498:d72c7e78ee13
Synchronized with git rev 60a7c0c0
Author: Rohit Grover
bring in the latest changes for BLE::init() where we allow <object, member> tuples for init callback.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rgrover1 496:08bd8a46630b 1 /*
rgrover1 496:08bd8a46630b 2 * Copyright (c) Nordic Semiconductor ASA
rgrover1 496:08bd8a46630b 3 * All rights reserved.
rgrover1 496:08bd8a46630b 4 *
rgrover1 496:08bd8a46630b 5 * Redistribution and use in source and binary forms, with or without modification,
rgrover1 496:08bd8a46630b 6 * are permitted provided that the following conditions are met:
rgrover1 496:08bd8a46630b 7 *
rgrover1 496:08bd8a46630b 8 * 1. Redistributions of source code must retain the above copyright notice, this
rgrover1 496:08bd8a46630b 9 * list of conditions and the following disclaimer.
rgrover1 496:08bd8a46630b 10 *
rgrover1 496:08bd8a46630b 11 * 2. Redistributions in binary form must reproduce the above copyright notice, this
rgrover1 496:08bd8a46630b 12 * list of conditions and the following disclaimer in the documentation and/or
rgrover1 496:08bd8a46630b 13 * other materials provided with the distribution.
rgrover1 496:08bd8a46630b 14 *
rgrover1 496:08bd8a46630b 15 * 3. Neither the name of Nordic Semiconductor ASA nor the names of other
rgrover1 496:08bd8a46630b 16 * contributors to this software may be used to endorse or promote products
rgrover1 496:08bd8a46630b 17 * derived from this software without specific prior written permission.
rgrover1 496:08bd8a46630b 18 *
rgrover1 496:08bd8a46630b 19 *
rgrover1 496:08bd8a46630b 20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
rgrover1 496:08bd8a46630b 21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
rgrover1 496:08bd8a46630b 22 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
rgrover1 496:08bd8a46630b 23 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
rgrover1 496:08bd8a46630b 24 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
rgrover1 496:08bd8a46630b 25 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
rgrover1 496:08bd8a46630b 26 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
rgrover1 496:08bd8a46630b 27 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
rgrover1 496:08bd8a46630b 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
rgrover1 496:08bd8a46630b 29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
rgrover1 496:08bd8a46630b 30 *
rgrover1 496:08bd8a46630b 31 */
rgrover1 496:08bd8a46630b 32 #ifndef _COMPILER_ABSTRACTION_H
rgrover1 496:08bd8a46630b 33 #define _COMPILER_ABSTRACTION_H
rgrover1 496:08bd8a46630b 34
rgrover1 496:08bd8a46630b 35 /*lint ++flb "Enter library region" */
rgrover1 496:08bd8a46630b 36
rgrover1 496:08bd8a46630b 37 #if defined ( __CC_ARM )
rgrover1 496:08bd8a46630b 38
rgrover1 496:08bd8a46630b 39 #ifndef __ASM
rgrover1 496:08bd8a46630b 40 #define __ASM __asm /*!< asm keyword for ARM Compiler */
rgrover1 496:08bd8a46630b 41 #endif
rgrover1 496:08bd8a46630b 42
rgrover1 496:08bd8a46630b 43 #ifndef __INLINE
rgrover1 496:08bd8a46630b 44 #define __INLINE __inline /*!< inline keyword for ARM Compiler */
rgrover1 496:08bd8a46630b 45 #endif
rgrover1 496:08bd8a46630b 46
rgrover1 496:08bd8a46630b 47 #ifndef __WEAK
rgrover1 496:08bd8a46630b 48 #define __WEAK __weak /*!< weak keyword for ARM Compiler */
rgrover1 496:08bd8a46630b 49 #endif
rgrover1 496:08bd8a46630b 50
rgrover1 496:08bd8a46630b 51 #define GET_SP() __current_sp() /*!> read current SP function for ARM Compiler */
rgrover1 496:08bd8a46630b 52
rgrover1 496:08bd8a46630b 53 #elif defined ( __ICCARM__ )
rgrover1 496:08bd8a46630b 54
rgrover1 496:08bd8a46630b 55 #ifndef __ASM
rgrover1 496:08bd8a46630b 56 #define __ASM __asm /*!< asm keyword for IAR Compiler */
rgrover1 496:08bd8a46630b 57 #endif
rgrover1 496:08bd8a46630b 58
rgrover1 496:08bd8a46630b 59 #ifndef __INLINE
rgrover1 496:08bd8a46630b 60 #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */
rgrover1 496:08bd8a46630b 61 #endif
rgrover1 496:08bd8a46630b 62
rgrover1 496:08bd8a46630b 63 #ifndef __WEAK
rgrover1 496:08bd8a46630b 64 #define __WEAK __weak /*!> define weak function for IAR Compiler */
rgrover1 496:08bd8a46630b 65 #endif
rgrover1 496:08bd8a46630b 66
rgrover1 496:08bd8a46630b 67 #define GET_SP() __get_SP() /*!> read current SP function for IAR Compiler */
rgrover1 496:08bd8a46630b 68
rgrover1 496:08bd8a46630b 69 #elif defined ( __GNUC__ )
rgrover1 496:08bd8a46630b 70
rgrover1 496:08bd8a46630b 71 #ifndef __ASM
rgrover1 496:08bd8a46630b 72 #define __ASM __asm__ /*!< asm keyword for GNU Compiler */
rgrover1 496:08bd8a46630b 73 #endif
rgrover1 496:08bd8a46630b 74
rgrover1 496:08bd8a46630b 75 #ifndef __INLINE
rgrover1 496:08bd8a46630b 76 #define __INLINE inline /*!< inline keyword for GNU Compiler */
rgrover1 496:08bd8a46630b 77 #endif
rgrover1 496:08bd8a46630b 78
rgrover1 496:08bd8a46630b 79 #ifndef __WEAK
rgrover1 496:08bd8a46630b 80 #define __WEAK __attribute__((weak)) /*!< weak keyword for GNU Compiler */
rgrover1 496:08bd8a46630b 81 #endif
rgrover1 496:08bd8a46630b 82
rgrover1 496:08bd8a46630b 83 #define GET_SP() gcc_current_sp() /*!> read current SP function for GNU Compiler */
rgrover1 496:08bd8a46630b 84
rgrover1 496:08bd8a46630b 85 static inline unsigned int gcc_current_sp(void)
rgrover1 496:08bd8a46630b 86 {
rgrover1 496:08bd8a46630b 87 register unsigned sp __ASM("sp");
rgrover1 496:08bd8a46630b 88 return sp;
rgrover1 496:08bd8a46630b 89 }
rgrover1 496:08bd8a46630b 90
rgrover1 496:08bd8a46630b 91 #elif defined ( __TASKING__ )
rgrover1 496:08bd8a46630b 92
rgrover1 496:08bd8a46630b 93 #ifndef __ASM
rgrover1 496:08bd8a46630b 94 #define __ASM __asm /*!< asm keyword for TASKING Compiler */
rgrover1 496:08bd8a46630b 95 #endif
rgrover1 496:08bd8a46630b 96
rgrover1 496:08bd8a46630b 97 #ifndef __INLINE
rgrover1 496:08bd8a46630b 98 #define __INLINE inline /*!< inline keyword for TASKING Compiler */
rgrover1 496:08bd8a46630b 99 #endif
rgrover1 496:08bd8a46630b 100
rgrover1 496:08bd8a46630b 101 #ifndef __WEAK
rgrover1 496:08bd8a46630b 102 #define __WEAK __attribute__((weak)) /*!< weak keyword for TASKING Compiler */
rgrover1 496:08bd8a46630b 103 #endif
rgrover1 496:08bd8a46630b 104
rgrover1 496:08bd8a46630b 105 #define GET_SP() __get_MSP() /*!> read current SP function for TASKING Compiler */
rgrover1 496:08bd8a46630b 106
rgrover1 496:08bd8a46630b 107 #endif
rgrover1 496:08bd8a46630b 108
rgrover1 496:08bd8a46630b 109 /*lint --flb "Leave library region" */
rgrover1 496:08bd8a46630b 110
rgrover1 496:08bd8a46630b 111 #endif