2022-05-17 03:56:25 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "aum1_cm1.h"
|
|
|
|
|
|
|
|
struct InterruptLock {
|
2022-06-19 07:46:30 +00:00
|
|
|
uint32_t old_primask;
|
2022-05-17 03:56:25 +00:00
|
|
|
|
2022-06-19 07:46:30 +00:00
|
|
|
InterruptLock() : old_primask(__get_PRIMASK()) { __disable_irq(); }
|
2022-05-17 03:56:25 +00:00
|
|
|
|
|
|
|
~InterruptLock() {
|
2022-06-19 07:46:30 +00:00
|
|
|
__set_PRIMASK(old_primask);
|
2022-05-17 03:56:25 +00:00
|
|
|
}
|
|
|
|
};
|