1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00
RIOT/cpu/msp430-common/irq.c
Oliver Hahm 8304a8ae7b [board/msb-430-common board/eZ430-Chronos cpu/msp430*]
* reorganized msp430 based cpu folders
2010-12-08 12:16:49 +01:00

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();
}