diff --git a/core/hwtimer.c b/core/hwtimer.c index c68f2fa325..3c7152b458 100644 --- a/core/hwtimer.c +++ b/core/hwtimer.c @@ -150,16 +150,12 @@ static int _hwtimer_set(unsigned long offset, void (*callback)(void*), void *ptr unsigned state; - if (!inISR()) { - state = disableIRQ(); - } + state = disableIRQ(); int n = lifo_get(lifo); if (n == -1) { - if (!inISR()) { - restoreIRQ(state); - } + restoreIRQ(state); puts("No hwtimer left."); return -1; @@ -179,9 +175,7 @@ static int _hwtimer_set(unsigned long offset, void (*callback)(void*), void *ptr lpm_prevent_sleep++; - if (!inISR()) { - restoreIRQ(state); - } + restoreIRQ(state); return n; } diff --git a/core/include/arch/irq_arch.h b/core/include/arch/irq_arch.h index 554fb2ce59..d57db05405 100644 --- a/core/include/arch/irq_arch.h +++ b/core/include/arch/irq_arch.h @@ -16,6 +16,9 @@ * This file acts as a wrapper between the kernels interrupt interface and the architecture * dependent implementation of the interfaces. * + * @note All functions in this module have to be implemented in a way that it + * is safe to call them from within the context of an ISR. + * * @author Hauke Petersen */