BLE_Nano nRF51 Central heart rate
Embed:
(wiki syntax)
Show/hide line numbers
nrf_svc.h
00001 /* 00002 * Copyright (c) Nordic Semiconductor ASA 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without modification, 00006 * are permitted provided that the following conditions are met: 00007 * 00008 * 1. Redistributions of source code must retain the above copyright notice, this 00009 * list of conditions and the following disclaimer. 00010 * 00011 * 2. Redistributions in binary form must reproduce the above copyright notice, this 00012 * list of conditions and the following disclaimer in the documentation and/or 00013 * other materials provided with the distribution. 00014 * 00015 * 3. Neither the name of Nordic Semiconductor ASA nor the names of other 00016 * contributors to this software may be used to endorse or promote products 00017 * derived from this software without specific prior written permission. 00018 * 00019 * 4. This software must only be used in a processor manufactured by Nordic 00020 * Semiconductor ASA, or in a processor manufactured by a third party that 00021 * is used in combination with a processor manufactured by Nordic Semiconductor. 00022 * 00023 * 00024 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 00025 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00026 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00027 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 00028 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00029 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00030 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 00031 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00032 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00033 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00034 * 00035 */ 00036 00037 #ifndef NRF_SVC__ 00038 #define NRF_SVC__ 00039 00040 #include "stdint.h" 00041 00042 #ifdef __cplusplus 00043 extern "C" { 00044 #endif 00045 00046 #ifdef SVCALL_AS_NORMAL_FUNCTION 00047 #define SVCALL(number, return_type, signature) return_type signature 00048 #else 00049 00050 #ifndef SVCALL 00051 #if defined (__CC_ARM) 00052 #define SVCALL(number, return_type, signature) return_type __svc(number) signature 00053 #elif defined (__GNUC__) 00054 #ifdef __cplusplus 00055 #define GCC_CAST_CPP (uint8_t) 00056 #else 00057 #define GCC_CAST_CPP 00058 #endif 00059 #define SVCALL(number, return_type, signature) \ 00060 _Pragma("GCC diagnostic push") \ 00061 _Pragma("GCC diagnostic ignored \"-Wreturn-type\"") \ 00062 __attribute__((naked)) \ 00063 __attribute__((unused)) \ 00064 static return_type signature \ 00065 { \ 00066 __asm( \ 00067 "svc %0\n" \ 00068 "bx r14" : : "I" (GCC_CAST_CPP number) : "r0" \ 00069 ); \ 00070 } \ 00071 _Pragma("GCC diagnostic pop") 00072 00073 #elif defined (__ICCARM__) 00074 #define PRAGMA(x) _Pragma(#x) 00075 #define SVCALL(number, return_type, signature) \ 00076 PRAGMA(swi_number = (number)) \ 00077 __swi return_type signature; 00078 #else 00079 #define SVCALL(number, return_type, signature) return_type signature 00080 #endif 00081 #endif // SVCALL 00082 00083 #endif // SVCALL_AS_NORMAL_FUNCTION 00084 00085 #ifdef __cplusplus 00086 } 00087 #endif 00088 #endif // NRF_SVC__ 00089
Generated on Wed Jul 13 2022 07:07:19 by 1.7.2