Patched version of nrf51822 FOTA compatible driver, with GPTIO disabled, as it clashed with the mbed definitions...

Fork of nRF51822 by Nordic Semiconductor

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers nrf_svc.h Source File

nrf_svc.h

00001 #ifndef NRF_SVC__
00002 #define NRF_SVC__
00003 
00004 #ifdef SVCALL_AS_NORMAL_FUNCTION
00005 #define SVCALL(number, return_type, signature) return_type signature
00006 #else
00007 
00008 #ifndef SVCALL
00009 #if defined (__CC_ARM)
00010 #define SVCALL(number, return_type, signature) return_type __svc(number) signature
00011 #elif defined (__GNUC__)
00012 #define SVCALL(number, return_type, signature) \
00013   _Pragma("GCC diagnostic ignored \"-Wreturn-type\"") \
00014   _Pragma("GCC diagnostic ignored \"-Wunused-function\"") \
00015   __attribute__((naked)) static return_type signature \
00016   { \
00017     __asm( \
00018         "svc %0\n" \
00019         "bx r14" : : "I" ((uint32_t)number) : "r0" \
00020     ); \
00021   }
00022 #elif defined (__ICCARM__)
00023 #define PRAGMA(x) _Pragma(#x)
00024 #define SVCALL(number, return_type, signature) \
00025 PRAGMA(swi_number = number) \
00026  __swi return_type signature;
00027 #else
00028 #define SVCALL(number, return_type, signature) return_type signature  
00029 #endif
00030 #endif  // SVCALL
00031 
00032 #endif  // SVCALL_AS_NORMAL_FUNCTION
00033 #endif  // NRF_SVC__