project for nrf51822 qfab

Dependencies:   eddystone_URL mbed

Fork of eddystone_URL by vo dung

Committer:
jksoft
Date:
Wed Nov 12 02:40:34 2014 +0000
Revision:
0:76dfa9657d9d
????????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jksoft 0:76dfa9657d9d 1 #ifndef NRF_SVC__
jksoft 0:76dfa9657d9d 2 #define NRF_SVC__
jksoft 0:76dfa9657d9d 3
jksoft 0:76dfa9657d9d 4 #ifdef SVCALL_AS_NORMAL_FUNCTION
jksoft 0:76dfa9657d9d 5 #define SVCALL(number, return_type, signature) return_type signature
jksoft 0:76dfa9657d9d 6 #else
jksoft 0:76dfa9657d9d 7
jksoft 0:76dfa9657d9d 8 #ifndef SVCALL
jksoft 0:76dfa9657d9d 9 #if defined (__CC_ARM)
jksoft 0:76dfa9657d9d 10 #define SVCALL(number, return_type, signature) return_type __svc(number) signature
jksoft 0:76dfa9657d9d 11 #elif defined (__GNUC__)
jksoft 0:76dfa9657d9d 12 #define SVCALL(number, return_type, signature) \
jksoft 0:76dfa9657d9d 13 _Pragma("GCC diagnostic ignored \"-Wreturn-type\"") \
jksoft 0:76dfa9657d9d 14 _Pragma("GCC diagnostic ignored \"-Wunused-function\"") \
jksoft 0:76dfa9657d9d 15 __attribute__((naked)) static return_type signature \
jksoft 0:76dfa9657d9d 16 { \
jksoft 0:76dfa9657d9d 17 __asm( \
jksoft 0:76dfa9657d9d 18 "svc %0\n" \
jksoft 0:76dfa9657d9d 19 "bx r14" : : "I" ((uint32_t)number) : "r0" \
jksoft 0:76dfa9657d9d 20 ); \
jksoft 0:76dfa9657d9d 21 }
jksoft 0:76dfa9657d9d 22 #elif defined (__ICCARM__)
jksoft 0:76dfa9657d9d 23 #define PRAGMA(x) _Pragma(#x)
jksoft 0:76dfa9657d9d 24 #define SVCALL(number, return_type, signature) \
jksoft 0:76dfa9657d9d 25 PRAGMA(swi_number = number) \
jksoft 0:76dfa9657d9d 26 __swi return_type signature;
jksoft 0:76dfa9657d9d 27 #else
jksoft 0:76dfa9657d9d 28 #define SVCALL(number, return_type, signature) return_type signature
jksoft 0:76dfa9657d9d 29 #endif
jksoft 0:76dfa9657d9d 30 #endif // SVCALL
jksoft 0:76dfa9657d9d 31
jksoft 0:76dfa9657d9d 32 #endif // SVCALL_AS_NORMAL_FUNCTION
jksoft 0:76dfa9657d9d 33 #endif // NRF_SVC__