diff --git a/cpu/msp430-common/include/cpu.h b/cpu/msp430-common/include/cpu.h index c929b774b1..a542d88859 100644 --- a/cpu/msp430-common/include/cpu.h +++ b/cpu/msp430-common/include/cpu.h @@ -22,7 +22,6 @@ */ #include -#include #include #include "board.h" @@ -40,6 +39,11 @@ extern "C" { */ #define WORDSIZE 16 +/** + * @brief Macro for defining interrupt service routines + */ +#define ISR(a,b) void __attribute__((naked, interrupt (a))) b(void) + /** * @brief The current ISR state (inside or not) */ @@ -50,13 +54,6 @@ extern volatile int __inISR; */ extern char __isr_stack[MSP430_ISR_STACK_SIZE]; -/** - * @brief definition of legacy interrupt control functions - */ -#define eINT enableIRQ -#define dINT disableIRQ -/** @} */ - /** * @brief Save the current thread context from inside an ISR */ @@ -105,7 +102,7 @@ inline void __restore_context_isr(void) inline void __enter_isr(void) { __save_context_isr(); - __asm__("mov.w %0,r1" : : "i"(__isr_stack+MSP430_ISR_STACK_SIZE)); + __asm__("mov.w %0,r1" : : "i"(__isr_stack + MSP430_ISR_STACK_SIZE)); __inISR = 1; } diff --git a/cpu/msp430-common/msp430-main.c b/cpu/msp430-common/msp430-main.c index 807e67b826..834cb2de52 100644 --- a/cpu/msp430-common/msp430-main.c +++ b/cpu/msp430-common/msp430-main.c @@ -43,6 +43,7 @@ */ #include "cpu.h" +#include "irq.h" /*---------------------------------------------------------------------------*/ static void @@ -109,10 +110,10 @@ static char *cur_break = (char *) &_end; void msp430_cpu_init(void) { - dint(); + disableIRQ(); init_ports(); // lpm_init(); - eint(); + enableIRQ(); if ((uintptr_t)cur_break & 1) { /* Workaround for msp430-ld bug!*/ cur_break++;