mbed library sources modified for open wear
Dependents: openwear-lifelogger-example
Fork of mbed-src by
Diff: targets/cmsis/TARGET_NXP/TARGET_LPC23XX/core_arm7.h
- Revision:
- 15:4892fe388435
- Parent:
- 13:0645d8841f51
diff -r 096882eb0961 -r 4892fe388435 targets/cmsis/TARGET_NXP/TARGET_LPC23XX/core_arm7.h --- a/targets/cmsis/TARGET_NXP/TARGET_LPC23XX/core_arm7.h Mon Aug 05 14:54:27 2013 +0000 +++ b/targets/cmsis/TARGET_NXP/TARGET_LPC23XX/core_arm7.h Wed Aug 07 16:43:59 2013 +0300 @@ -8,6 +8,8 @@ #ifndef __ARM7_CORE_H__ #define __ARM7_CORE_H__ +#include "vector_defns.h" + #ifdef __cplusplus extern "C" { #endif @@ -255,6 +257,15 @@ NVIC->IntEnClr = 1 << (uint32_t)IRQn; } +static __INLINE uint32_t __get_IPSR(void) +{ + unsigned i; + + for(i = 0; i < 32; i ++) + if(NVIC->Address == NVIC->VectAddr[i]) + return i; + return 1; // 1 is an invalid entry in the interrupt table on LPC2368 +} #ifdef __cplusplus }