From 9b1e180cd81ad08c0c0f64e2986a5913809c7f14 Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Thu, 30 Oct 2014 12:07:55 +0100 Subject: [PATCH 1/2] core: eliminate warning This initialized has actually no relevance and is just needed to suppress a compiler warning. --- core/hwtimer.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/core/hwtimer.c b/core/hwtimer.c index c68f2fa325a7..3c7152b458a2 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; } From 4885690874393861698186ee015f1ada6d2f5937 Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Thu, 30 Oct 2014 14:34:11 +0100 Subject: [PATCH 2/2] core: update irq_arch documentation --- core/include/arch/irq_arch.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/include/arch/irq_arch.h b/core/include/arch/irq_arch.h index 554fb2ce5959..d57db05405ba 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 */