BLE FOTA APP

Dependencies:   BLE_API mbed

It doesn't work with the default FOTA bootloader. It use NVIC_SystemReset() to enter a bootloader.

Committer:
yihui
Date:
Fri Oct 10 03:36:28 2014 +0000
Revision:
1:a607cd9655d7
use NVIC_SystemReset() to run bootloader

Who changed what in which revision?

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