To get started with Seeed Tiny BLE, include detecting motion, button and battery level.

Dependencies:   BLE_API eMPL_MPU6050 mbed nRF51822

Committer:
yihui
Date:
Wed Apr 22 07:47:17 2015 +0000
Revision:
1:fc2f9d636751
update libraries; ; delete nRF51822/nordic-sdk/components/gpiote/app_gpiote.c to solve GPIOTE_IRQHandler multiply defined issue. temperarily change nRF51822 library to folder

Who changed what in which revision?

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