arm: async echo app

This commit is contained in:
2022-05-16 20:56:25 -07:00
parent 30d9a2d7c8
commit 932b8d4582
25 changed files with 3043 additions and 29 deletions

18
arm/lock.h Normal file
View File

@@ -0,0 +1,18 @@
#pragma once
#include "aum1_cm1.h"
struct InterruptLock {
bool was_locked;
InterruptLock()
: was_locked(__get_PRIMASK() != 0) {
__disable_irq();
}
~InterruptLock() {
if (!was_locked) {
__enable_irq();
}
}
};