cpu/cortexm_common: replace irq_restore by __set_PRIMASK for stm32l152re

- The __NOP() that was added in #8518 is now remooved.
- When DBG_STANDBY, DBG_STOP or DBG_SLEEP are set in DBG_CR a hardfault
  occurs on wakeup from sleep. This was first diagnosed in #8518. When
  enabled, a hardfault occured when returning from a branch to irq_restore()
  we avoid the call by inlining the function call. See #11830 for more
  details.
This commit is contained in:
Francisco Molina 2019-07-12 11:14:31 +02:00
parent 4139370a87
commit d075e55bb4

View File

@ -171,10 +171,11 @@ static inline void cortexm_sleep(int deep)
__DSB();
__WFI();
#if defined(CPU_MODEL_STM32L152RE)
/* STM32L152RE crashes without this __NOP(). See #8518. */
__NOP();
#endif
/* STM32L152RE crashes if branching to irq_restore(state). See #11830. */
__set_PRIMASK(state);
#else
irq_restore(state);
#endif
}
/**