1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/msp430-common/irq.c
Oliver Hahm 82f2e3d4e0 * added missing makefiles for msb430h
* updated some makefiles and fixed includes for msb430h
2013-02-11 22:10:03 +01:00

25 lines
437 B
C

#include <irq.h>
#include <msp430x16x.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();
}