mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
25 lines
432 B
C
25 lines
432 B
C
#include <irq.h>
|
|
#include <board.h>
|
|
#include <cpu.h>
|
|
|
|
unsigned int disableIRQ() {
|
|
unsigned int state;
|
|
__asm__("mov.w r2,%0" : "=r" (state));
|
|
state &= GIE;
|
|
if (state) dINT();
|
|
return state;
|
|
}
|
|
|
|
unsigned int enableIRQ() {
|
|
unsigned int state;
|
|
__asm__("mov.w r2,%0" : "=r" (state));
|
|
state &= GIE;
|
|
if (!state) eINT();
|
|
return state;
|
|
}
|
|
|
|
void restoreIRQ(unsigned int state) {
|
|
if (state) eINT();
|
|
}
|
|
|