mbed library sources. Supersedes mbed-src. Fixed broken STM32F1xx RTC on rtc_api.c
Dependents: Nucleo_F103RB_RTC_battery_bkup_pwr_off_okay
Fork of mbed-dev by
Diff: platform/mbed_critical.c
- Revision:
- 167:e84263d55307
- Parent:
- 160:d5399cc887bb
- Child:
- 170:19eb464bc2be
diff -r c97ed07ec1a8 -r e84263d55307 platform/mbed_critical.c --- a/platform/mbed_critical.c Thu Jun 08 15:02:37 2017 +0100 +++ b/platform/mbed_critical.c Wed Jun 21 17:46:44 2017 +0100 @@ -37,6 +37,22 @@ #endif } +bool core_util_is_isr_active(void) +{ +#if defined(__CORTEX_A9) + switch(__get_CPSR() & 0x1FU) { + case MODE_USR: + case MODE_SYS: + return false; + case MODE_SVC: + default: + return true; + } +#else + return (__get_IPSR() != 0U); +#endif +} + MBED_WEAK void core_util_critical_section_enter(void) { bool interrupts_disabled = !core_util_are_interrupts_enabled();