arm: interrupt lock fix
This commit is contained in:
parent
61b92f5faa
commit
ec024adfff
@ -3,13 +3,11 @@
|
||||
#include "aum1_cm1.h"
|
||||
|
||||
struct InterruptLock {
|
||||
bool was_locked;
|
||||
uint32_t old_primask;
|
||||
|
||||
InterruptLock() : was_locked(__get_PRIMASK() != 0) { __disable_irq(); }
|
||||
InterruptLock() : old_primask(__get_PRIMASK()) { __disable_irq(); }
|
||||
|
||||
~InterruptLock() {
|
||||
if (!was_locked) {
|
||||
__enable_irq();
|
||||
}
|
||||
__set_PRIMASK(old_primask);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user