mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
cpu/arm7_common: simplify irq_restore()
We do not manipulate the CPSR register outside of irq_%, so we can just restore it's previous value and don't have to fiddle with the IRQ MASK bit. See https://www.keil.com/pack/doc/CMSIS/Core_A/html/group__CMSIS__CPSR.html
This commit is contained in:
parent
8d0e902d38
commit
e26ed32cd6
@ -58,10 +58,7 @@ static inline __attribute__((always_inline)) unsigned irq_disable(void)
|
||||
|
||||
static inline __attribute__((always_inline)) void irq_restore(unsigned oldCPSR)
|
||||
{
|
||||
unsigned _cpsr;
|
||||
|
||||
_cpsr = __get_cpsr();
|
||||
__set_cpsr((_cpsr & ~IRQ_MASK) | (oldCPSR & IRQ_MASK));
|
||||
__set_cpsr(oldCPSR);
|
||||
}
|
||||
|
||||
static inline __attribute__((always_inline)) unsigned irq_enable(void)
|
||||
|
Loading…
Reference in New Issue
Block a user